Created
July 21, 2023 10:28
-
-
Save zakkg3/12d275be66b9f8582bb16fa7375bbf8b to your computer and use it in GitHub Desktop.
Kubernetes Rsync job - rsync 2 pvc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiVersion": "batch/v1", | |
"kind": "Job", | |
"metadata": { | |
"labels": { "job-name": "CHANGEME" }, | |
"name": "CHANGEME" | |
}, | |
"spec": { | |
"backoffLimit": 1, | |
"completions": 1, | |
"parallelism": 1, | |
"selector": { "matchLabels": null }, | |
"template": { | |
"metadata": { | |
"labels": { "job-name": "CHANGEME" } | |
}, | |
"spec": { | |
"containers": [ | |
{ | |
"command": [ "rsync", "-av", "/src/", "/dst/" ], | |
"image": "instrumentisto/rsync-ssh", | |
"name": "rsync", | |
"volumeMounts": [ | |
{ "mountPath": "/src", "name": "source-pvc", "readOnly": true }, | |
{ "mountPath": "/dst", "name": "destination-pvc", "readOnly": false } | |
] | |
} | |
], | |
"restartPolicy": "Never", | |
"securityContext": { | |
"runAsUser": 0 | |
}, | |
"volumes": [ | |
{ | |
"name": "source-pvc", | |
"persistentVolumeClaim": { | |
"claimName": "CHANGEME", | |
"readOnly": true | |
} | |
}, | |
{ | |
"name": "destination-pvc", | |
"persistentVolumeClaim": { | |
"claimName": "CHANGEME" | |
} | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment