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

feat: merge backup & forget cronjobs

parent bc91c1b3
No related branches found
No related tags found
No related merge requests found
Pipeline #2859 passed
......@@ -2,5 +2,5 @@ apiVersion: v2
name: restic
description: Helm Chart for restic
type: application
version: 1.0.1
version: 1.0.2
appVersion: "0.13.1"
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "restic-helm.fullname" . }}-backup
name: {{ include "restic-helm.fullname" . }}
labels:
{{- include "restic-helm.labels" . | nindent 4 }}
spec:
......@@ -35,7 +35,7 @@ spec:
- name: data
{{- .Values.volume | nindent 14 }}
containers:
- name: {{ .Chart.Name }}
- name: backup
securityContext:
{{- toYaml .Values.securityContext | nindent 16 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
......@@ -54,6 +54,22 @@ spec:
volumeMounts:
- mountPath: "/sync"
name: data
- name: forget
securityContext:
{{- toYaml .Values.securityContext | nindent 16 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
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 }}
......
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:
restartPolicy: OnFailure
{{- 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 }}
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