Skip to content

Commit

Permalink
doc: remove or copy volume job
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevader committed Oct 26, 2023
1 parent 7009f13 commit fa995d6
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion docs/longhorn.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,45 @@ longhorn:
backupTarget: 's3://k3sbackups@us-east-1/longhorn'
backupTargetCredentialSecret: minio-secret
...
```
```

## Copy from one Volume to another

```yaml title="copy-job.yaml"
apiVersion: batch/v1
kind: Job
metadata:
namespace: default # namespace where the PVC's exist
name: volume-migration
spec:
completions: 1
parallelism: 1
backoffLimit: 3
template:
metadata:
name: volume-migration
labels:
name: volume-migration
spec:
restartPolicy: Never
containers:
- name: volume-migration
image: ubuntu:xenial
tty: true
command: [ "/bin/sh" ]
args: [ "-c", "cp -r -v /mnt/old /mnt/new" ]
volumeMounts:
- name: old-vol
mountPath: /mnt/old
- name: new-vol
mountPath: /mnt/new
volumes:
- name: old-vol
persistentVolumeClaim:
claimName: data-source-pvc # change to data source PVC
- name: new-vol
persistentVolumeClaim:
claimName: data-target-pvc # change to data target PVC
```

0 comments on commit fa995d6

Please sign in to comment.