apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "cv-app.fullname" . }}-backend labels: {{- include "cv-app.labels" . | nindent 4 }} app.kubernetes.io/component: backend spec: replicas: {{ .Values.backend.replicaCount }} selector: matchLabels: {{- include "cv-app.selectorLabels" . | nindent 6 }} app.kubernetes.io/component: backend template: metadata: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "cv-app.selectorLabels" . | nindent 8 }} app.kubernetes.io/component: backend spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "cv-app.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: backend securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.backend.image.pullPolicy }} ports: - name: http containerPort: 3001 protocol: TCP envFrom: - configMapRef: name: {{ include "cv-app.fullname" . }}-config - secretRef: name: {{ include "cv-app.fullname" . }}-secret volumeMounts: - name: data mountPath: /app/data livenessProbe: httpGet: path: /health port: http readinessProbe: httpGet: path: /health port: http resources: {{- toYaml .Values.backend.resources | nindent 12 }} volumes: - name: data {{- if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ include "cv-app.fullname" . }}-data {{- else }} emptyDir: {} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}