apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "cctp.fullname" . }} labels: {{- include "cctp.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "cctp.selectorLabels" . | nindent 6 }} template: metadata: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "cctp.selectorLabels" . | nindent 8 }} {{- include "cctp.commonLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "cctp.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} {{- if .Values.files }} initContainers: - name: copy-{{ .Release.Name }}-config image: busybox command: ['sh', '-c', 'cp /configmap/* /config/'] volumeMounts: - name: configmap mountPath: /configmap - name: {{ .Release.Name }}-config mountPath: /config {{- end }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: {{- toYaml .Values.args | nindent 12 }} {{- if .Values.env }} env: {{- toYaml .Values.env | nindent 12 }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: configmap mountPath: /config {{- if .extraContainers }} {{- toYaml .extraContainers | nindent 8 }} {{- 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 }} volumes: {{- if .Values.files }} - name: {{ .Release.Name }}-config emptyDir: {} - name: configmap configMap: name: {{ include "cctp.fullname" . }}-{{ .Release.Name }} {{- end }}