CSI driver in AKS - Issue with CRDS while helm install of csi driver

59 Views Asked by At

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"

1

There are 1 best solutions below

0
Arko On

The error message suggests that the volumesnapshotclasses.snapshot.storage.k8s.io CRD 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

kubectl delete crd volumesnapshotclasses.snapshot.storage.k8s.io

After deletion, you can retry installing the CSI driver using Helm, ensuring it creates a new CRD with the correct metadata. enter image description here

Second way i.e. to update the existing CRD, use the command

kubectl edit crd volumesnapshotclasses.snapshot.storage.k8s.io

i.e. Open the CRD for editing using command kubectl edit crd volumesnapshotclasses.snapshot.storage.k8s.io

Look for the metadata: section near the top of the CRD definition. Inside the metadata: section, you'll find labels: and annotations: subsections. Add your missing labels and annotations accordingly. If they don't exist, you will need to create them.

enter image description here

enter image description here

and save your changes

kubectl get crd volumesnapshotclasses.snapshot.storage.k8s.io -o yaml

enter image description here

Reference : CSI driver using helm