From eb79f16cbe35f8ce08bee7e6b98a2f83be632dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Wed, 4 Oct 2023 20:47:24 +0200 Subject: [PATCH] add pre-sync --- templates/pre-sync.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 templates/pre-sync.yaml diff --git a/templates/pre-sync.yaml b/templates/pre-sync.yaml new file mode 100644 index 0000000..3d395c6 --- /dev/null +++ b/templates/pre-sync.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: batch/v1 +kind: Job +metadata: + generateName: etcd-backup- + annotations: + argocd.argoproj.io/hook: PreSync + argocd.argoproj.io/sync-wave: "1" +spec: + backoffLimit: 3 + template: + spec: + restartPolicy: Never + containers: + - name: etcd-backup + image: quay.io/coreos/etcd:{{ .Values.etcd.tag }} + volumeMounts: + - mountPath: /data + name: data + subPath: etcd + command: + - etcdctl + - --endpoints=http://etcd:2379 + - snap + - save + - /data/snap-{{ now | unixEpoch }} + + volumes: + - name: data + persistentVolumeClaim: + claimName: etcd-backups +