This repository has been archived on 2024-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
onechart/charts/cron-job/templates/cronJob.yaml
T
2021-08-05 11:50:18 +02:00

66 lines
2.1 KiB
YAML

apiVersion: batch/v1beta1
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 }}
command:
- {{ .Values.shell }}
- -c
- {{ .Values.command | quote }}
envFrom:
{{- if .Values.vars }}
- configMapRef:
name: {{ .Release.Name }}
{{- end }}
{{- if .Values.secret.enabled }}
- secretRef:
name: {{ .Release.Name }}
{{- end }}
volumeMounts:
{{- range .Values.volumes }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 16 }}
volumes:
{{- range .Values.volumes }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ printf "%s-%s" $.Release.Name .name }}
{{- 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 }}