# Given we run on an hourly schedule, replace the previous container
concurrencyPolicy: Replace
jobTemplate:
spec:
ttlSecondsAfterFinished: 172800 # 48 hours
template:
metadata:
+ labels:
+ app: scheduler
annotations:
checksum/config: {{ include (print $.Template.BasePath "/kolab-configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/kolab-secret.yaml") . | sha256sum }}
spec:
{{- if .Values.image.pullSecret }}
imagePullSecrets:
- name: registry-pull-secret
{{- end }}
containers:
- name: scheduler
image: {{ .Values.image.kolabImage }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
#Run artisan schedule:run, but wait for all subprocesses to exit. https://www.jeffgeerling.com/blog/2019/running-php-artisan-schedulerun-laravel-kubernetes-cronjobs
command: ["/bin/sh"]
args: ["-c", "php artisan schedule:run 2>&1 && while pgrep php > /dev/null; do sleep 1; done"]
envFrom:
- configMapRef:
name: kolab-config
- secretRef:
name: kolab-config-secret
env:
{{- if .Values.kolab.tenantId }}
- name: APP_TENANT_ID
value: "{{ .Values.kolab.tenantId }}"
{{- end }}
{{- include "kolab.env" .Values.kolab | indent 12 }}