PVC Missing Selector on Restore #8432
-
Hey! I don't think this is an issue with Velero, I think it's more of a misunderstanding on my part on how to backup and recover a PV/PVC where I'm not actually restoring the contents of the PV, just the kubernetes resource that is associated to the PV/PVC. In a helm chart, I have a PV and PVC defined:
I created a velero schedule with the following it, where the PV and PVC are both included:
From here, I created a backup from the snapshot, and confirm both the PV and the PVC both show up within the backup by doing a To test out the recovery process, I then Then, I do a recovery via velero and confirm that the PV and the PVCs are both restored and bound properly, and everything comes up OK. This includes restoring the secrets that helm was maintaining for that release (so I can do my
The problem I run into is I can no longer do a
But the restored PVC no longer has those selectors:
I'm wondering if I'm missing something super obvious here? One option I would have is to just not include the pv/pvc in the backup, and just I tried doing some searching across issues/discussions and couldn't find anything obvious, so apologies if this has been answered already. Thanks!! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Can you describe the generated backup? |
Beta Was this translation helpful? Give feedback.
-
Sorry for the late reply on this; definitely, here it is:
|
Beta Was this translation helpful? Give feedback.
-
If you are referring to the section in red below being missing ---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: shared-pv-claim
namespace: my_namespace
spec:
storageClassName: nfs
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
selector:
- matchLabels:
- name: shared-pv-volume-xyz then it is expected. Per below, label selector limits volumes that can be bound to the claim.
The selector are being removed by this code velero/pkg/backup/actions/backup_pv_action.go Lines 71 to 77 in 9f0026d came in via #6481 to resolve #6444 If there is a reason why selector should be there in the PVC after restore please open an issue title like |
Beta Was this translation helpful? Give feedback.
If you are referring to the section in red below being missing
then it is expected.
Per below, label selector limits volumes that can be bound to the claim.