apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "deploy.serviceFullname" (dict "root" . "svcKey" "app") }} labels: {{- include "deploy.labels" . | nindent 4 }} app.kubernetes.io/component: app spec: replicas: {{ .Values.services.app.replicaCount | default 1 }} selector: matchLabels: {{- include "deploy.serviceSelectorLabels" (dict "root" . "svcKey" "app") | nindent 6 }} template: metadata: labels: {{- include "deploy.labels" . | nindent 8 }} app.kubernetes.io/component: app spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "deploy.serviceAccountName" . }} {{- with .Values.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} containers: - name: app {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} image: "{{ .Values.imageRegistry }}/{{ .Values.services.app.repository }}:{{ .Values.imageTag | default .Chart.AppVersion }}" imagePullPolicy: IfNotPresent {{- with .Values.services.app.command }} command: {{- toYaml . | nindent 12 }} {{- end }} ports: - name: http containerPort: {{ .Values.services.app.port }} protocol: TCP envFrom: - configMapRef: name: {{ .Values.configMapName }} {{- with .Values.services.app.extraEnv }} env: {{- range $key, $val := . }} - name: {{ $key }} value: {{ $val | quote }} {{- end }} {{- end }} livenessProbe: httpGet: path: /health port: http initialDelaySeconds: 10 periodSeconds: 15 readinessProbe: httpGet: path: /health port: http initialDelaySeconds: 5 periodSeconds: 10 {{- with .Values.services.app.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.services.app.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} {{- end }} volumes: - name: shared-data persistentVolumeClaim: claimName: shared-data {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}