Helm-operator: Questions: Why does the CRD require manual installation instead of using the `crd-install` hook?

Created on 26 Nov 2019  路  4Comments  路  Source: fluxcd/helm-operator

The helm-operator chart docs say to apply the CRD manually. The Helm 2 docs say that the annotation "helm.sh/hook": "crd-install" will ensure that a CRD is installed before other resources.

I've seen this on other charts, too. Is requiring manual install a backward compatibility thing? Does the crd-install hook work poorly? It seems like this would be an easy change, but I'm suspicious that it might be like this for good reason.

question

All 4 comments

It is possible, we just do not encourage it as it tends to be problematic when using Helm in a declarative way.

Flux would for example not be able to sync any custom resources for as long as the custom resource definition has not been applied to the cluster, which may be fine if you gradually add resources to your cluster, but becomes more problematic when you are performing a disaster recovery.

Another reason is that the lifecycle of a CRD handled by Helm is still quite immature, see: https://github.com/helm/helm/issues/4863

Does Helm 3 improve on the situation, or is it just an aesthetic change (crds directory instead of a hook annotation)?

Helm 3 applies the crds content only at install so we can't rely on it to ship CRD updates, that's why we chose to move the HelmRelease definition outside of the chart.

Thanks to both of you. This has been very helpful.

Was this page helpful?
0 / 5 - 0 ratings