crd-install for does not work in helm v2 command

A few days ago, when I tried to install the below application with the latest helm chart using helm v2 command, I got an error message complaining that the helm chart is a helm v3 chart.

After struggling for a while, I removed the components that I don’t need and converted the helm v3 chart into a helm v2 chart. However, the installation still failed, when I had another try using the new chart. The CRD resources contained in the helm chart was not created by helm v2 command. This is because helm v2 chart uses a special kind of helm hook named ‘crd-install’ to create the CRD resources as stated below:

Helm v3 chart uses a different strategy as below. It contains a directory named ‘crds’ to contain the CRD resource definition. Helm v3 command will automatically create the CRD resources under this directory. However, helm v2 command doesn’t recognize this convention or rule.

I tried to modify the CRD resources in the helm chart to use ‘crd-install’ hook, but got the below error message

Error: unable to convert to CRD type: no kind “CustomResourceDefinition” is registered for version “” in scheme “”

After searching it using google, I find the below ticket for helm. This is because helm v2 command doesn’t recognize “” schema. It only recognize “” schema.

From the below lines of code, we can see that helm v2 command only recognize “” schema, while helm v3 command recognize both of “recognize “” and “”.

helm v2 command:

helm v3 command:

A good recommendation is to migrate from helm v2 to helm v3. If this is not possible, then you need to create these CRD resources manually using kubectl command. This is usually a one-shot work for a Kubernetes cluster and won’t cause too much work.