apiVersion: batch/v1 kind: CronJob metadata: name: {{ .Release.Name }} namespace: {{ .Release.Namespace }} labels: {{- include "helm-chart.labels" . | nindent 4 }} spec: schedule: {{ .Values.schedule | quote }} {{- with .Values.constraints }} {{- toYaml . | nindent 2 }} {{- end }} jobTemplate: spec: template: spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: Never containers: - name: {{ .Release.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" {{- if .Values.vars }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- end }} {{- if .Values.overrideCommand }} command: - {{ .Values.shell }} - -c - {{ .Values.command | quote }} {{- end }} {{- include "common.envFromRef.tpl" . | nindent 14 }} {{- include "common.volumeMountsRef.tpl" . | nindent 14 }} resources: {{- toYaml .Values.resources | nindent 16 }} {{- include "common.volumesRef.tpl" . | nindent 10 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 12 }} {{- end }}