kubernetes-sigs / node-feature-discovery

Node feature discovery for Kubernetes
Apache License 2.0
792 stars 245 forks source link

feat: install CRDs from a subchart #1922

Open cmontemuino opened 1 month ago

cmontemuino commented 1 month ago

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 #1637

k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cmontemuino Once this PR has been reviewed and has the lgtm label, please assign marquiz for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
k8s-ci-robot commented 1 month ago

Hi @cmontemuino. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
netlify[bot] commented 1 month ago

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
Latest commit 3f3ab44cb8ec8deb5b1ad2f6e356d5109f6d8375
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/6731f62f1bdb240008045216
Deploy Preview https://deploy-preview-1922--kubernetes-sigs-nfd.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

TessaIO commented 1 month ago

Thanks for the patch @cmontemuino. I saw, that you added the new CRD installation without removing the old CRDs manifests. Wouldn't that be an issue if we installed both Helm charts (the NFD and CRD) as it would try to create the same CRD twice and fail?

cmontemuino commented 1 month ago

Thanks for the patch @cmontemuino. I saw, that you added the new CRD installation without removing the old CRDs manifests. Wouldn't that be an issue if we installed both Helm charts (the NFD and CRD) as it would try to create the same CRD twice and fail?

Thanks for raising this point @TessaIO, as it requires more clarification.

My initial take was to make this feature completely optional. The assumption here is that there could be a use case for using Helm 3 CRDs approach.

This is what I've added in the values.yaml:

# -- Toggle to install and upgrade CRDs from a subchart. Make sure to use it with `--skip-crds` to avoid conflicts.

And also reflected it in the helm.md file -- general parameters section.

I'd say a section in helm.md detailing this new addition makes sense. That's where I'm struggling about how the documentation is generated. For example, should I add a new section in the same lines as in https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/docs/deployment/helm.md#from-v014 ?

k8s-ci-robot commented 1 week ago

Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages.

The list of commits with invalid commit messages:

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).