Files
apigateway-ocp/apigateway/templates/cronjob/cronjob.yaml
Conan Scott 555c441ad1 Updated to 7.7.0.20250830-3-BN0276-ubi
Updated ANM destinationCertCA for 7.7.0.20250830-3-BN0276-ubi
2025-11-20 15:56:45 +08:00

60 lines
2.0 KiB
YAML

{{- if .Values.cronjob.enabled -}}
apiVersion: batch/v1
kind: CronJob
metadata:
name: purge-files
labels:
{{- include "gateway.labels" . | nindent 4 }}
app.kubernetes.io/component: cronjob
spec:
schedule: "{{ .Values.cronjob.schedule }}"
jobTemplate:
spec:
ttlSecondsAfterFinished: {{ .Values.cronjob.job_ttl }}
template:
metadata:
labels:
{{- include "gateway.labels" . | nindent 12 }}
app.kubernetes.io/component: cronjob
spec:
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
containers:
- name: purge-files-job
image: {{ default .Values.global.initContainers.image .Values.cronjob.image | quote }}
args:
- /bin/sh
- -c
- echo "purging event files older than {{ .Values.cronjob.older_than }}"; find /events -type f -mtime {{ .Values.cronjob.older_than }} -exec rm -rf {} \;
volumeMounts:
- name: eventsvol
mountPath: "/events"
{{- with .Values.global.initContainers.resources }}
resources:
{{ toYaml . | nindent 14 }}
{{- end }}
{{- with .Values.global.initContainers.securityContext }}
securityContext:
{{- toYaml . | nindent 14 }}
{{- end }}
restartPolicy: OnFailure
volumes:
- name: eventsvol
persistentVolumeClaim:
claimName: {{ .Values.cronjob.claimName }}
{{- with .Values.cronjob.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.cronjob.affinity }}
affinity:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.cronjob.tolerations }}
tolerations:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}