apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "fullname" . }} labels: {{- include "labels" . | nindent 4 }} spec: replicas: {{ .Values.chart.replicaCount }} selector: matchLabels: {{- include "selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "selectorLabels" . | nindent 8 }} spec: {{- with .Values.chart.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.chart.debug.enabled }} initContainers: - name: debug image: alpine:3.19 command: ["sleep", "infinity"] envFrom: {{- if .Values.chart.config }} - configMapRef: name: {{ include "fullname" . }}-config {{- end }} {{- if .Values.chart.secret.existingSecretName }} - secretRef: name: {{ .Values.chart.secret.existingSecretName }} {{- end }} {{- if .Values.chart.persistence.enabled }} volumeMounts: - name: {{ include "pvcName" . }} mountPath: /data {{- end }} securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: false capabilities: drop: - all {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.chart.image.repository }}:{{ .Values.chart.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.chart.image.pullPolicy }} {{- with .Values.chart.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} ports: - name: http containerPort: {{ .Values.chart.service.targetPort }} protocol: TCP envFrom: {{- if .Values.chart.config }} - configMapRef: name: {{ include "fullname" . }}-config {{- end }} {{- if .Values.chart.secret.existingSecretName }} - secretRef: name: {{ .Values.chart.secret.existingSecretName }} {{- end }} {{- if .Values.chart.persistence.enabled }} volumeMounts: - name: {{ include "pvcName" . }} mountPath: /data {{- end }} {{- with .Values.chart.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} {{- if not .Values.chart.debug.enabled }} {{- with .Values.chart.livenessProbe }} livenessProbe: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.chart.readinessProbe }} readinessProbe: {{- toYaml . | nindent 12 }} {{- end }} {{- end }} {{- if not .Values.chart.persistence.enabled }} volumes: - name: {{ include "pvcName" . }} emptyDir: {} {{- end }} {{- with .Values.chart.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.chart.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.chart.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }}