mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-28 06:26:33 +10:00
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "fullname" . }}
|
|
labels:
|
|
app: {{ template "fullname" . }}
|
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
release: "{{ .Release.Name }}"
|
|
heritage: "{{ .Release.Service }}"
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ template "fullname" . }}
|
|
spec:
|
|
initContainers:
|
|
- name: git-clone-app
|
|
image: {{ .Values.image }}
|
|
imagePullPolicy: {{ .Values.imagePullPolicy }}
|
|
command: [ '/bin/sh', '-c' , 'git clone {{ .Values.repository }} /app && git checkout {{ .Values.revision }}']
|
|
volumeMounts:
|
|
- name: app
|
|
mountPath: /app
|
|
- name: npm-install
|
|
image: {{ .Values.image }}
|
|
imagePullPolicy: {{ .Values.imagePullPolicy }}
|
|
workingDir: /app
|
|
command: ['npm', 'install']
|
|
volumeMounts:
|
|
- name: app
|
|
mountPath: /app
|
|
containers:
|
|
- name: {{ template "fullname" . }}
|
|
securityContext:
|
|
readOnlyRootFilesystem: true
|
|
image: "{{ .Values.image }}"
|
|
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
|
|
env:
|
|
- name: GIT_REPO
|
|
value: {{ .Values.repository }}
|
|
command: [ "npm", "start" ]
|
|
ports:
|
|
- name: http
|
|
containerPort: 3000
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
initialDelaySeconds: 180
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
initialDelaySeconds: 30
|
|
timeoutSeconds: 3
|
|
periodSeconds: 5
|
|
resources:
|
|
{{ toYaml .Values.resources | indent 10 }}
|
|
volumeMounts:
|
|
- name: app
|
|
mountPath: /app
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.path }}
|
|
volumes:
|
|
- name: app
|
|
emptyDir: {}
|
|
- name: data
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ template "fullname" . }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|