Files
chart/library/ix-dev/charts/nextcloud/templates/cronjob.yaml
Stavros Kois 01c726962b NAS-123887 / 24.04 / use the upstream suggested cron style (#1503)
* use the upstream suggested cron style

* bump
2023-09-04 20:53:03 +03:00

79 lines
2.7 KiB
YAML

{{ $cronjob_values := (. | mustDeepCopy) }}
{{ $_ := set $cronjob_values "common" (dict "nameSuffix" "cronjob") }}
{{ $hostName := .Values.nextcloud.host }}
{{ if .Values.useServiceNameForHost }}
{{ $hostName = (include "common.names.fullname" .) }}
{{ end }}
{{if .Values.cronjob.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ template "common.names.fullname" $cronjob_values }}
labels:
app: {{ template "common.names.name" $cronjob_values }}
chart: {{ template "common.names.chart" $cronjob_values }}
release: {{ .Release.Name }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
spec:
schedule: "{{ .Values.cronjob.schedule }}"
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 2
successfulJobsHistoryLimit: 1
jobTemplate:
metadata:
labels:
app: {{ template "common.names.name" $cronjob_values }}
release: {{ .Release.Name }}
{{- include "common.labels.selectorLabels" $cronjob_values | nindent 8 }}
spec:
template:
metadata:
labels:
app: {{ template "common.names.name" $cronjob_values }}
release: {{ .Release.Name }}
{{- include "common.labels.selectorLabels" $cronjob_values | nindent 12 }}
spec:
restartPolicy: Never
securityContext:
runAsUser: 33
runAsGroup: 0
fsGroup: 33
containers:
- name: {{ .Chart.Name }}-cronjob
image: "{{.Values.image.repository }}:{{.Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- php
- -f
- /var/www/html/cron.php
volumeMounts:
- name: nextcloud-data
mountPath: /var/www/
subPath: "root"
- name: nextcloud-data
mountPath: /var/www/html
subPath: "html"
- name: nextcloud-data
mountPath: {{ .Values.nextcloud.datadir }}
subPath: "data"
- name: nextcloud-data
mountPath: /var/www/html/config
subPath: "config"
- name: nextcloud-data
mountPath: /var/www/html/custom_apps
subPath: "custom_apps"
- name: nextcloud-data
mountPath: /var/www/tmp
subPath: "tmp"
- name: nextcloud-data
mountPath: /var/www/html/themes
subPath: "themes"
volumes:
{{ if .Values.appVolumeMounts }}
{{- include "common.storage.configureAppVolumes" .Values | nindent 12 }}
{{ end }}
{{ end }}