How to Backup a Specific Persistent Volume (PV) Using Labels or Name? #8843
Replies: 1 comment
-
|
The current environment is EKS with Velero 1.15.2, installed using a Helm chart. In this setup, the PersistentVolumeClaim (PVC) with the label name: gitea-shared-storage needs to be backed up along with its associated PersistentVolume (PV). The PVC must have this label, but the PV does not require it. If the PVC references a PV, the PV will still be included in the backup even without the label. To ensure the PV is backed up, the flag velero backup create velero-gitea-persistence-volume-test \
--include-cluster-resources=true \
--include-resources pv,pvc \
--include-namespaces gitea \
--selector "name=gitea-shared-storage"After running the backup, the result can be checked using: velero backup describe velero-gitea-persistence-volume-test --detailsTotal items to be backed up: 2
Items backed up: 2
Resource List:
v1/PersistentVolume:
- pvc-b6ec150e-5bfd-4faf-a2f8-ed217b85f587
v1/PersistentVolumeClaim:
- gitea/gitea-shared-storage
Backup Volumes:
Velero-Native Snapshots:
pvc-b6ec150e-5bfd-4faf-a2f8-ed217b85f587:
Snapshot ID: snap-08cc68e11c5787af6
Type: gp3
Availability Zone: ap-northeast-2c
IOPS: 0
Result: succeededFrom the output, it is confirmed that the PVC named gitea/gitea-shared-storage has been backed up, along with its corresponding PV pvc-b6ec150e-5bfd-4faf-a2f8-ed217b85f587. The backup was completed using a Velero-native snapshot, and the snapshot details show that the snapshot ID is snap-08cc68e11c5787af6, with a volume type of gp3, located in the ap-northeast-2c availability zone. The backup result indicates that the snapshot was successfully created. To verify the backup at the infrastructure level, the AWS EC2 console can be checked for an EBS snapshot corresponding to the backed-up PV. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Issue
Is there a way to back up only a specific Persistent Volume (PV) based on its name or label?
I attempted to filter and back up a PV using a label, as shown below:
Resource List from the Backup:
apps/v1/Deployment: - n8n/n8n discovery.k8s.io/v1/EndpointSlice: - n8n/n8n-8r5p4 networking.k8s.io/v1/Ingress: - n8n/n8n v1/ConfigMap: - n8n/n8n v1/Endpoints: - n8n/n8n v1/Namespace: - n8n v1/PersistentVolumeClaim: - n8n/n8n v1/Pod: - n8n/n8n-649c948665-hhvxz v1/Service: - n8n/n8n v1/ServiceAccount: - n8n/n8nThe PV is not included in the backup. Is there a way to filter and back up only a specific PV based on its label or resource name?
Beta Was this translation helpful? Give feedback.
All reactions