1 {{- if .Values.backup.enabled }}
2 {{- $release := .Release }}
3 {{- $values := .Values }}
4 {{- $backup := $values.backup }}
5 {{- range $index, $schedule := $backup.schedule }}
7 apiVersion: batch/v1beta1
10 name: {{ template "cassandra.fullname" $ }}-backup-{{ $schedule.keyspace | replace "_" "-" }}
12 app: {{ template "cassandra.name" $ }}-cain
13 chart: {{ template "cassandra.chart" $ }}
14 release: "{{ $release.Name }}"
15 heritage: "{{ $release.Service }}"
17 schedule: {{ $schedule.cron | quote }}
18 concurrencyPolicy: Forbid
19 startingDeadlineSeconds: 120
25 {{ toYaml $backup.annotations }}
27 restartPolicy: OnFailure
28 serviceAccountName: {{ template "cassandra.serviceAccountName" $ }}
30 - name: cassandra-backup
31 image: "{{ $backup.image.repos }}:{{ $backup.image.tag }}"
36 - {{ $release.Namespace }}
38 - release={{ $release.Name }},app={{ template "cassandra.name" $ }}
40 - {{ $schedule.keyspace }}
42 - {{ $backup.destination }}
43 {{- with $backup.extraArgs }}
44 {{ toYaml . | indent 12 }}
46 {{- with $backup.env }}
48 {{ toYaml . | indent 12 }}
50 {{- with $backup.resources }}
52 {{ toYaml . | indent 14 }}
56 preferredDuringSchedulingIgnoredDuringExecution:
62 - {{ template "cassandra.fullname" $ }}
67 topologyKey: "kubernetes.io/hostname"
68 {{- with $values.tolerations }}
70 {{ toYaml . | indent 10 }}