Skip to content

Instantly share code, notes, and snippets.

@zakkg3
Created July 21, 2023 10:28
Show Gist options
  • Save zakkg3/12d275be66b9f8582bb16fa7375bbf8b to your computer and use it in GitHub Desktop.
Save zakkg3/12d275be66b9f8582bb16fa7375bbf8b to your computer and use it in GitHub Desktop.
Kubernetes Rsync job - rsync 2 pvc
{
"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