Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm 3 cannot find crds #537

Closed
restingbull opened this issue Mar 19, 2025 · 8 comments
Closed

helm 3 cannot find crds #537

restingbull opened this issue Mar 19, 2025 · 8 comments

Comments

@restingbull
Copy link

restingbull commented Mar 19, 2025

Helm version: version.BuildInfo{Version:"v3.17.1", GitCommit:"980d8ac1939e39138101364400756af2bdee1da5", GitTreeState:"clean", GoVersion:"go1.23.6"}

Chart version: 0.23.2

$ helm show crds
$

Without this, the crds are not installed before usage.

@restingbull
Copy link
Author

Hm. Ok, this is ugly. helm 3 doesn't support templating crds.

Which means moving the crds becomes backwards incompatible with crds.create = true

@rmoreas
Copy link

rmoreas commented Mar 19, 2025

I'm new to this chart and this issue makes me think: What is the procedure to update the CRDs?

I like the way Rancher does this, they provide a separate helm chart to install/update CRDs. See for example https://github.com/rancher/charts/tree/dev-v2.10/charts/rancher-monitoring-crd/105.1.3%2Bup61.3.2.

@restingbull
Copy link
Author

I'm new to this chart and this issue makes me think: What is the procedure to update the CRDs?

I like the way Rancher does this, they provide a separate helm chart to install/update CRDs. See for example https://github.com/rancher/charts/tree/dev-v2.10/charts/rancher-monitoring-crd/105.1.3%2Bup61.3.2.

That does seem like a more elegant solution. There do not seem to be enough knobs to only create the crds in the current chart (Deployment, Service, and ConfigMap are always created).

The current view is that the lack of the ability to update CRDs via helm leans towards keeping them in a templates directory.

@itay-grudev
Copy link
Collaborator

itay-grudev commented Mar 20, 2025

The current behavior (having the CRDs as a template) is beneficial for the ordinary user as it makes sure the CRDs are upgraded automatically along with the operator through the helm chart.

If you need to manage the CRDs in another way, set the crds.create=false flag.

You can fetch the CRDs for a given version of the operator by running:

CNPG_VERSION=1.25.1
kustomize build https://github.com/cloudnative-pg/cloudnative-pg/config/helm/\?ref\=v$CNPG_VERSION > crds.yaml

@restingbull
Copy link
Author

If you need to manage the CRDs in another way, set the crds.create=false flag.

@itay-grudev

Would you be open to a pr that adds conditionals for Deployment, Service, and ConfigMap to install the crds independently?

@itay-grudev
Copy link
Collaborator

Why? What would it improve? What bug would it fix?

@restingbull
Copy link
Author

restingbull commented Mar 22, 2025

The one where the chart currently create Deployment, Service, and ConfigMap. Currently, if you want to use the chart as a dependency, and create a Cluster resource you must either pre-install the CRDS outside of helm. Otherwise, if you attempt to use the chart to install the CRDS, you end up creating the Deployment, Service, and ConfigMap.

It's bit a non-ideal, and makes the chart less of a reusable building block. My goal is have a reusable stack to that configure a cluster without an undue amount of manual steps.

@itay-grudev
Copy link
Collaborator

I'm sorry, but I'm missing the point. Why doesn't it work by just installing the chart? CRDs and everything else at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants