Unable to continue with install: CustomResourceDefinition "volumesnapshotclasses.snapshot.storage.k8s.io" in namespace "" exists and cannot be imported into the current release:
invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to xxx driver
annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "hubs-driver"
The error message suggests that the
volumesnapshotclasses.snapshot.storage.k8s.ioCRD already exists but lacks specific labels and annotations required by Helm for management.There are two ways to resolving this- Deleting the CRD or Updating CRD Metadata
where deleting and reinstalling the crd is the easier method
After deletion, you can retry installing the CSI driver using Helm, ensuring it creates a new CRD with the correct metadata.
Second way i.e. to update the existing CRD, use the command
i.e. Open the CRD for editing using command
kubectl edit crd volumesnapshotclasses.snapshot.storage.k8s.ioLook for the
metadata:section near the top of the CRD definition. Inside themetadata:section, you'll findlabels:andannotations:subsections. Add your missing labels and annotations accordingly. If they don't exist, you will need to create them.and save your changes
Reference : CSI driver using helm