Try livenessprobe
This commit is contained in:
parent
030de7dd64
commit
9de204737a
1 changed files with 15 additions and 3 deletions
|
@ -4,6 +4,7 @@ metadata:
|
||||||
name: backup
|
name: backup
|
||||||
spec:
|
spec:
|
||||||
schedule: "0 0 * * *"
|
schedule: "0 0 * * *"
|
||||||
|
concurrencyPolicy: Forbid
|
||||||
jobTemplate:
|
jobTemplate:
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
@ -11,12 +12,14 @@ spec:
|
||||||
volumes:
|
volumes:
|
||||||
- name: backup-storage
|
- name: backup-storage
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
- name: ipc-storage
|
||||||
|
emptyDir: {}
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
containers:
|
containers:
|
||||||
- name: backup-container
|
- name: backup-container
|
||||||
image: docker.sunet.se/drive/duplicity:bookworm-slim-1
|
image: docker.sunet.se/drive/duplicity:bookworm-slim-1
|
||||||
command: ["duplicity"]
|
command: ["bash"]
|
||||||
args: ["/backup_storage", "rclone://destination:$(BUCKET)", "--no-encryption", "--full-if-older-than", "1M" ]
|
args: [ "-c" "duplicity /backup_storage rclone://destination:$(BUCKET) --no-encryption --full-if-older-than 1M; touch /backup_ipc/stop" ]
|
||||||
env:
|
env:
|
||||||
- name: RCLONE_CONFIG_DESTINATION_ACL
|
- name: RCLONE_CONFIG_DESTINATION_ACL
|
||||||
value: private
|
value: private
|
||||||
|
@ -30,11 +33,17 @@ spec:
|
||||||
- name: backup-storage
|
- name: backup-storage
|
||||||
mountPath: /backup_storage
|
mountPath: /backup_storage
|
||||||
mountPropagation: HostToContainer
|
mountPropagation: HostToContainer
|
||||||
|
- name: backup-storage
|
||||||
|
mountPath: /backup_ipc
|
||||||
|
mountPropagation: Bidirectional
|
||||||
- name: mount-container
|
- name: mount-container
|
||||||
image: rclone/rclone:1.69.0
|
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:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command: ["bash", "-c", "if test -f /backup_ipc/stop; then umount /backup_storage; exit 1; fi;"]
|
||||||
env:
|
env:
|
||||||
- name: RCLONE_CONFIG_SOURCE_ACL
|
- name: RCLONE_CONFIG_SOURCE_ACL
|
||||||
value: private
|
value: private
|
||||||
|
@ -48,3 +57,6 @@ spec:
|
||||||
- name: backup-storage
|
- name: backup-storage
|
||||||
mountPath: /backup_storage
|
mountPath: /backup_storage
|
||||||
mountPropagation: Bidirectional
|
mountPropagation: Bidirectional
|
||||||
|
- name: backup-storage
|
||||||
|
mountPath: /backup_ipc
|
||||||
|
mountPropagation: HostToContainer
|
||||||
|
|
Loading…
Add table
Reference in a new issue