Update Unlock Volsync jobs for new R2/Minio setup.

This commit is contained in:
Joseph Hanson 2024-03-19 11:50:55 -05:00
parent b508ad9d91
commit 37f2f83739
3 changed files with 40 additions and 21 deletions

View file

@ -42,7 +42,7 @@ tasks:
silent: true silent: true
cmds: cmds:
- envsubst < <(cat {{.unlockJobTemplate}}) | kubectl apply -f - - envsubst < <(cat {{.unlockJobTemplate}}) | kubectl apply -f -
- bash {{.waitForJobScript}} unlock-{{.rsrc}}-{{.ts}} {{.namespace}} # - bash {{.waitForJobScript}} unlock-{{.rsrc}}-{{.ts}} {{.namespace}}
- kubectl -n {{.namespace}} wait job/unlock-{{.rsrc}}-{{.ts}} --for condition=complete --timeout=1m - kubectl -n {{.namespace}} wait job/unlock-{{.rsrc}}-{{.ts}} --for condition=complete --timeout=1m
- kubectl -n {{.namespace}} logs job/unlock-{{.rsrc}}-{{.ts}} --container unlock - kubectl -n {{.namespace}} logs job/unlock-{{.rsrc}}-{{.ts}} --container unlock
- kubectl -n {{.namespace}} delete job unlock-{{.rsrc}}-{{.ts}} - kubectl -n {{.namespace}} delete job unlock-{{.rsrc}}-{{.ts}}
@ -51,7 +51,7 @@ tasks:
namespace: '{{.namespace | default "default"}}' namespace: '{{.namespace | default "default"}}'
env: *task-vars env: *task-vars
preconditions: preconditions:
- sh: test -f {{.waitForJobScript}} # - sh: test -f {{.waitForJobScript}}
- sh: test -f {{.unlockJobTemplate}} - sh: test -f {{.unlockJobTemplate}}
# To run backup jobs in parallel for all replicationsources: # To run backup jobs in parallel for all replicationsources:

View file

@ -0,0 +1,38 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: "unlock-${rsrc}-${ts}"
namespace: "${namespace}"
spec:
ttlSecondsAfterFinished: 3600
template:
spec:
automountServiceAccountToken: false
restartPolicy: OnFailure
containers:
- name: unlock
image: docker.io/restic/restic:0.16.0
args: ["unlock", "--remove-all"]
envFrom:
- secretRef:
name: "${rsrc}-volsync-r2-secret"
---
apiVersion: batch/v1
kind: Job
metadata:
name: "unlock-${rsrc}-r2-${ts}"
namespace: "${namespace}"
spec:
ttlSecondsAfterFinished: 3600
template:
spec:
automountServiceAccountToken: false
restartPolicy: OnFailure
containers:
- name: unlock
image: docker.io/restic/restic:0.16.0
args: ["unlock", "--remove-all"]
envFrom:
- secretRef:
name: "${rsrc}-volsync-secret"

View file

@ -1,19 +0,0 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: "unlock-${rsrc}-${ts}"
namespace: "${namespace}"
spec:
ttlSecondsAfterFinished: 3600
template:
spec:
automountServiceAccountToken: false
restartPolicy: OnFailure
containers:
- name: unlock
image: docker.io/restic/restic:0.16.0
args: ["unlock", "--remove-all"]
envFrom:
- secretRef:
name: "${rsrc}-restic-secret"