Try livenessprobe

This commit is contained in:
Micke Nordin 2025-02-07 15:44:49 +01:00
parent 030de7dd64
commit 9de204737a
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257

View file

@ -4,6 +4,7 @@ metadata:
name: backup
spec:
schedule: "0 0 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
@ -11,12 +12,14 @@ spec:
volumes:
- name: backup-storage
emptyDir: {}
- name: ipc-storage
emptyDir: {}
restartPolicy: Never
containers:
- name: backup-container
image: docker.sunet.se/drive/duplicity:bookworm-slim-1
command: ["duplicity"]
args: ["/backup_storage", "rclone://destination:$(BUCKET)", "--no-encryption", "--full-if-older-than", "1M" ]
command: ["bash"]
args: [ "-c" "duplicity /backup_storage rclone://destination:$(BUCKET) --no-encryption --full-if-older-than 1M; touch /backup_ipc/stop" ]
env:
- name: RCLONE_CONFIG_DESTINATION_ACL
value: private
@ -30,11 +33,17 @@ spec:
- name: backup-storage
mountPath: /backup_storage
mountPropagation: HostToContainer
- name: backup-storage
mountPath: /backup_ipc
mountPropagation: Bidirectional
- name: mount-container
image: rclone/rclone:1.69.0
args: ["mount", "--allow-non-empty", "--daemon", "source:$(BUCKET)", "/backup_storage"]
args: ["mount", "--allow-non-empty", "source:$(BUCKET)", "/backup_storage"]
securityContext:
privileged: true
livenessProbe:
exec:
command: ["bash", "-c", "if test -f /backup_ipc/stop; then umount /backup_storage; exit 1; fi;"]
env:
- name: RCLONE_CONFIG_SOURCE_ACL
value: private
@ -48,3 +57,6 @@ spec:
- name: backup-storage
mountPath: /backup_storage
mountPropagation: Bidirectional
- name: backup-storage
mountPath: /backup_ipc
mountPropagation: HostToContainer