From 6ca1580cd04391211c35af32883166f297a45c16 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..80b4073 --- /dev/null +++ b/templates/pre-sync.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: batch/v1 +kind: Job +metadata: + generate-name: etcd-backup- + annotations: + argocd.argoproj.io/hook: PreSync + argocd.argoproj.io/sync-wave: "1" +spec: + backoffLimit: 3 + template: + spec: + containers: + - name: etcd-backup + image: quay.io/coreos/etcd:{{ .Values.etcd.tag }} + restartPolicy: Never + 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 +