apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "app.name" . }} labels: app: {{ template "app.name" . }} chart: {{ template "app.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicas }} selector: matchLabels: app: {{ template "app.name" . }} release: {{ .Release.Name }} template: metadata: labels: app: {{ template "app.name" . }} release: {{ .Release.Name }} {{- if .Values.podAnnotations }} annotations: {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} serviceAccountName: {{ template "app.serviceAccountName" . }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if gt .Values.replicas 1.0 }} args: - --enable-leader-election {{- end }} securityContext: {{ toYaml .Values.securityContext | indent 12 }} resources: {{ toYaml .Values.resources | indent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{ toYaml . | indent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 8 }} {{- end }} {{- with .Values.podSecurityContext }} securityContext: {{ toYaml . | indent 8 }} {{- end }}