[go: up one dir, main page]

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 · 8 comments · May be fixed by #1922
Open

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

cmontemuino opened this issue Mar 22, 2024 · 8 comments · May be fixed by #1922
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

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
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 20, 2024
@cmontemuino
Copy link
Contributor Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 1, 2024
@marquiz
Copy link
Contributor
marquiz commented Jul 9, 2024

@cmontemuino thanks for the proposal. I like the idea 👍 Helm 3 CRD management is b0rken if you ask me as an end-user.

Would you be wiling to work on this?

@marquiz
Copy link
Contributor
marquiz commented Jul 9, 2024

@yevgeny-shnaidman
Copy link

@marquiz we once talked about unifying node-feature-dscovery and node-feature-discovery-operator repos. If this is something that we might start doing in a near future, that IMHO this issue might better be implemented after unification.

@ArangoGutierrez
Copy link
Contributor
ArangoGutierrez commented Jul 23, 2024

@marquiz
Copy link
Contributor
marquiz commented Sep 5, 2024

/milestone v0.18

@k8s-ci-robot k8s-ci-robot added this to the v0.18 milestone Sep 5, 2024
cmontemuino added a commit to cmontemuino/node-feature-discovery that referenced this issue Oct 22, 2024
ROBLEM: Helm 3 only install CRDs during the chart installation. Both
deletes and upgrades are not handled by Helm 3. It requires manual
intervention. Additionally, it is not possible to template CRDs. This is
especially important when installing the chart with an Argo CD
application.

SOLUTION: add the possibility to install the CRDs from a dependency
subchart. This allows clean uninstall, possibility for automated
upgrades, and templating. This feature comes disabled by default.

closes kubernetes-sigs#1637

Signed-off-by: cmontemuino <1761056+cmontemuino@users.noreply.github.com>
@cmontemuino cmontemuino linked a pull request Oct 22, 2024 that will close this issue
@cmontemuino
Copy link
Contributor Author

Initial PR: #1922

I don't know exactly how the documentation is supposed to be authored, so I've updated with the minimal details possible.

cmontemuino added a commit to cmontemuino/node-feature-discovery that referenced this issue Oct 22, 2024
PROBLEM: Helm 3 only install CRDs during the chart installation. Both
deletes and upgrades are not handled by Helm 3. It requires manual
intervention. Additionally, it is not possible to template CRDs. This is
especially important when installing the chart with an Argo CD
application.

SOLUTION: add the possibility to install the CRDs from a dependency
subchart. This allows clean uninstall, possibility for automated
upgrades, and templating. This feature comes disabled by default.

closes kubernetes-sigs#1637

Signed-off-by: cmontemuino <1761056+cmontemuino@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

6 participants