mirror of https://git.rancher.io/charts
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
{{- if and .Values.migrations.gitrepoJobsCleanup .Values.gitops.enabled }}
|
|
---
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: fleet-cleanup-gitrepo-jobs
|
|
spec:
|
|
schedule: "@daily"
|
|
concurrencyPolicy: Forbid
|
|
successfulJobsHistoryLimit: 0
|
|
failedJobsHistoryLimit: 1
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: fleet-job
|
|
spec:
|
|
serviceAccountName: gitjob
|
|
restartPolicy: Never
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsGroup: 1000
|
|
runAsUser: 1000
|
|
containers:
|
|
- name: cleanup
|
|
image: "{{ template "system_default_registry" . }}{{.Values.image.repository}}:{{.Values.image.tag}}"
|
|
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: false
|
|
privileged: false
|
|
command:
|
|
- fleet
|
|
args:
|
|
- cleanup
|
|
- gitjob
|
|
nodeSelector: {{ include "linux-node-selector" . | nindent 12 }}
|
|
tolerations: {{ include "linux-node-tolerations" . | nindent 12 }}
|
|
backoffLimit: 1
|
|
{{- end }}
|