apiVersion: batch/v1beta1 kind: CronJob metadata: name: {{ include "pv-resizer.fullname" . }} labels: {{- include "pv-resizer.labels" . | nindent 4 }} spec: # generate a random backup time between 1 and 5 AM schedule: {{ .Values.schedule }} concurrencyPolicy: Forbid jobTemplate: spec: template: metadata: labels: {{- include "pv-resizer.selectorLabels" . | nindent 12 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 12 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 12 }} containers: - name: {{ .Release.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: [ "/check_full_pvs.sh", "-f" ] restartPolicy: OnFailure {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 12 }} {{- end }}