Skip to content
Snippets Groups Projects
Verified Commit 022e199f authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

feat: improve restic backup options

parent b06f0e0e
No related branches found
No related tags found
No related merge requests found
Pipeline #2855 passed
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "restic-helm.fullname" . }}
name: {{ include "restic-helm.fullname" . }}-backup
labels:
{{- include "restic-helm.labels" . | nindent 4 }}
spec:
......
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "restic-helm.fullname" . }}-forget
labels:
{{- include "restic-helm.labels" . | nindent 4 }}
spec:
schedule: "{{ .Values.schedule }}"
jobTemplate:
metadata:
{{- with .Values.jobAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "restic-helm.labels" . | nindent 8 }}
spec:
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 12 }}
{{- end }}
labels:
{{- include "restic-helm.labels" . | nindent 12 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 16 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
workingDir: "/sync"
args:
- "-r"
- "{{ .Values.repository.name }}"
- "forget"
- "--prune"
{{- toYaml .Values.keepOptions | nindent 16 }}
envFrom:
- secretRef:
name: {{ include "restic-helm.fullname" . }}
resources:
{{- toYaml .Values.resources | nindent 16 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 12 }}
{{- end }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "restic-helm.fullname" . }}
name: {{ include "restic-helm.fullname" . }}-init
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook": post-install
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": hook-succeeded
labels:
......@@ -25,9 +25,6 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: data
{{- .Values.volume | nindent 10 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
......@@ -44,9 +41,6 @@ spec:
name: {{ include "restic-helm.fullname" . }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: "/sync"
name: data
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
......
......@@ -12,6 +12,10 @@ volume: |-
schedule: "0 0 * * *"
keepOptions:
- "--keep-daily"
- "7"
auth: |-
B2_ACCOUNT_ID: "AzureDiamond"
B2_ACCOUNT_KEY: "hunter2"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment