Interlegis Public Rancher Charts for Kubernetes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.5 KiB

{{- if .Values.instance.zeoclient }}
{{- if and .Values.persistence.enabled .Values.repozo.enabled }}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ include "portalmodelo.fullname" . }}-repozo
labels:
{{- include "portalmodelo.labels" . | nindent 4 }}
spec:
# generate a random backup time between 1 and 5 AM
schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * *
jobTemplate:
spec:
template:
metadata:
labels:
{{- include "portalmodelo.labels" . | nindent 12 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
containers:
- name: {{ .Release.Name }}-repozo
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
runAsNonRoot: false
runAsUser: 0
command:
- "/bin/bash"
- "-c"
args:
- "/plone/instance/bin/backup"
env:
- name: TZ
value: {{ .Values.portal.timeZone }}
volumeMounts:
- mountPath: /plone/instance/bin/backup
subPath: backup
name: backupscript
- mountPath: /data
name: data
- mountPath: /backup
name: backupvol
resources:
{{- toYaml .Values.resources.zeo | nindent 16 }}
restartPolicy: OnFailure
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ include "portalmodelo.fullname" . }}-data
- name: backupvol
persistentVolumeClaim:
claimName: {{ include "portalmodelo.fullname" . }}-backupvol
- name: backupscript
configMap:
name: {{ include "portalmodelo.fullname" . }}-backupscript
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end}}
{{- end}}