TrueChartsClone/charts/stable/nextcloud/templates/_cronjob.tpl

52 lines
1.5 KiB
Smarty
Raw Normal View History

{{/* Define the cronjob */}}
{{- define "nextcloud.cronjob" -}}
{{- $jobName := include "common.names.fullname" . }}
2021-07-02 18:49:23 +00:00
---
2021-07-02 21:59:17 +00:00
apiVersion: batch/v1beta1
kind: CronJob
metadata:
2021-07-02 18:49:23 +00:00
name: {{ printf "%s-cronjob" $jobName }}
labels:
{{- include "common.labels" . | nindent 4 }}
spec:
schedule: "{{ .Values.cronjob.schedule }}"
concurrencyPolicy: Forbid
{{- with .Values.cronjob.failedJobsHistoryLimit }}
failedJobsHistoryLimit: {{ . }}
{{- end }}
{{- with .Values.cronjob.successfulJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ . }}
{{- end }}
jobTemplate:
metadata:
spec:
template:
metadata:
spec:
restartPolicy: Never
{{- with (include "common.controller.volumes" . | trim) }}
volumes:
{{- nindent 12 . }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ default .Values.image.tag }}"
imagePullPolicy: {{ default .Values.image.pullPolicy }}
command: [ "php" ]
args:
- "-f"
- "/var/www/html/cron.php"
# Will mount configuration files as www-data (id: 33) by default for nextcloud
{{- with (include "common.controller.volumeMounts" . | trim) }}
volumeMounts:
{{ nindent 16 . }}
{{- end }}
securityContext:
2021-07-03 10:40:52 +00:00
runAsUser: 33
2021-07-03 10:58:26 +00:00
runAsGroup: 33
resources:
2021-07-02 18:49:23 +00:00
{{ toYaml .Values.resources | indent 16 }}
{{- end -}}