more complex waves

Mikaël Cluseau 2023-10-04 21:22:03 +02:00
parent 1b451f9318
commit 3a58cead36
3 changed files with 35 additions and 33 deletions

View File

@ -15,6 +15,8 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: etcd
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
replicas: 1
selector:

View File

@ -2,7 +2,7 @@
apiVersion: batch/v1
kind: Job
metadata:
generateName: wave-1-etcd-backup-
generateName: presync-wave-1-etcd-backup-
annotations:
argocd.argoproj.io/hook: PreSync
argocd.argoproj.io/sync-wave: "1"
@ -30,35 +30,3 @@ spec:
persistentVolumeClaim:
claimName: etcd-backups
---
apiVersion: batch/v1
kind: Job
metadata:
generateName: wave-2-migrate-
annotations:
argocd.argoproj.io/hook: PreSync
argocd.argoproj.io/sync-wave: "2"
spec:
backoffLimit: 3
template:
spec:
restartPolicy: Never
containers:
- name: migrate
image: {{ .Values.migrate.repo }}:{{ .Values.migrate.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

32
templates/sync.yaml Normal file
View File

@ -0,0 +1,32 @@
---
apiVersion: batch/v1
kind: Job
metadata:
generateName: sync-wave-2-migrate-
annotations:
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/sync-wave: "2"
spec:
backoffLimit: 3
template:
spec:
restartPolicy: Never
containers:
- name: migrate
image: {{ .Values.migrate.repo }}:{{ .Values.migrate.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