Files
2025-11-30 09:05:12 +08:00

58 lines
1.9 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "CHARTNAME.fullname" . }}
labels:
{{- include "CHARTNAME.labels" . | nindent 4 }}
spec:
{{- if .Values.job.backoffLimit }}
backoffLimit: {{ .Values.job.backoffLimit }}
{{- end }}
{{- if .Values.job.activeDeadlineSeconds }}
activeDeadlineSeconds: {{ .Values.job.activeDeadlineSeconds }}
{{- end }}
{{- if .Values.job.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ .Values.job.ttlSecondsAfterFinished }}
{{- end }}
template:
metadata:
labels:
{{- include "CHARTNAME.selectorLabels" . | nindent 8 }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
restartPolicy: {{ .Values.job.restartPolicy | default "OnFailure" }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "CHARTNAME.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.job.command }}
command:
{{- toYaml .Values.job.command | nindent 12 }}
{{- end }}
{{- if .Values.job.args }}
args:
{{- toYaml .Values.job.args | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.env }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}