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

Install CRDs from a subchart instead of using Helm 3 crds directory #1637

Open
cmontemuino opened this issue Mar 22, 2024 · 0 comments
Open
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@cmontemuino
Copy link
Contributor

What would you like to be added:
Depart away from Helm 3 way to install CRDs and use a subchart for it.

Why is this needed:

Moving CRDs to a chart solves several issues: clean uninstall, possibility for upgrades, templating.

Motivation and Context

My main motivation is to have a better experience when managing this operator with Argo CD. That said, moving away from Helm 3 approach to install CRDs might be helpful in other scenarios too. I'm posting the full rationale below.

Helm 3 does not manage CRDs (see https://helm.sh/docs/chart_best_practices/custom_resource_definitions/). helm uninstall won't remove CRDs, and helm updgrade won't upgrade them. Manual intervention is required with the current setup.

  • CRDs installed from crds folder are not included into the helm release.
  • Additionally, it is not possible to template CRDs in Helm 3 in the crds folder.

The following comes from helm best practices around CRDs:

There is no support at this time for upgrading or deleting CRDs using Helm. This was an explicit decision after much community discussion due to the danger for unintentional data loss.

ref: https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you

Another alternatively, which is what I propose and comes from Helm page:

Another way to do this is to put the CRD definition in one chart, and then put any resources that use that CRD in another chart.

In this method, each chart must be installed separately. However, this workflow may be more useful for cluster operators who have admin access to a cluster

ref: https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-2-separate-charts

I'm completely fine to open a PR with the required refactoring, without impacting current installations.

@cmontemuino cmontemuino added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 22, 2024
@cmontemuino cmontemuino changed the title Installa CRDs from a subchart instead of using Helm 3 crds directory Install CRDs from a subchart instead of using Helm 3 crds directory Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant