consul-k8s
consul-k8s copied to clipboard
Why is the Consul Helm chart handling CRDs the way it is?
Question
I was wondering whether there is a specific reason why the Consul Helm chart doesn't handle CRDs according to the official recommendations? As of Helm 3 the correct way of shipping CRDs with a Helm chart is to place their manifests in a special crds/ directory inside the chart, as described here https://helm.sh/docs/topics/charts/#custom-resource-definitions-crds. There's also the following statement in this page: CRD files cannot be templated. They must be plain YAML documents.
The current custom resource definitions, which come with the Consul Helm chart are just regular template files in the templates/ directory and they also rely on being templated. This might lead to unexpected results, especially if the Helm chart is being consumed as a subchart/dependency, because the idea of the crds/ directory is that all CRDs have to be installed first, before all other Kubernetes resources.
Helm Configuration
[using the default values]
Current understanding and Expected behavior
Shouldn't the installation of the CRDs be handled as described in the official Helm documentation?
Hi @vladimir-shopov, we spent a lot of time looking into this and the problem with the Helm "way" is that it doesn't allow you to update those CRDs when you release a new version and users run helm upgrade. The CRDs in crds/ are only installed once on initial install. This wasn't acceptable to us because we need to update the CRDs as we make changes to Consul.
Closing as a response was provided.