Skip to content
Snippets Groups Projects
Commit 90cd5569 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

added cronjob and backup script

parent e333f3d0
No related branches found
No related tags found
No related merge requests found
Pipeline #7293 failed
apiVersion: batch/v1
kind: CronJob
metadata:
creationTimestamp: null
name: {{ include "chart.fullname" . }}-backup
spec:
jobTemplate:
metadata:
creationTimestamp: null
name: {{ include "chart.fullname" . }}-backup
labels:
{{- include "chart.selectorLabels" . | nindent 6 }}
spec:
template:
metadata:
creationTimestamp: null
labels:
{{- include "chart.selectorLabels" . | nindent 10 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
volumes:
- name: order-data
persistentVolumeClaim:
claimName: order-data
{{- if .Values.application.secretName }}
- name: application-secret
secret:
secretName: {{ .Values.application.secretName }}
defaultMode: 420
{{- end }}
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: {{ .Chart.Name }}-backup
command: ["/bin/bash"]
args: ["-c", "bin/do_backup"]
securityContext:
{{- toYaml .Values.securityContext | nindent 14 }}
volumeMounts:
- name: order-data
mountPath: /data
{{- if .Values.application.secretName }}
- name: application-secret
readOnly: true
mountPath: /app/config/production.json
subPath: production.json
{{- end }}
restartPolicy: OnFailure
schedule: '*/15 * * * *'
\ No newline at end of file
#!/bin/bash
set -e
node backup
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment