-
Notifications
You must be signed in to change notification settings - Fork 247
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
feat: install CRDs from a subchart #1922
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cmontemuino The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 # -- 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 I'd say a section in |
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 <[email protected]>
2ec2038
to
c60d355
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cmontemuino for the clarifications. I put some comments, I'll review it one more time once this is ready.
@@ -13,3 +13,7 @@ keywords: | |||
- node-labels | |||
type: application | |||
version: 0.2.1 | |||
dependencies: | |||
- name: crds | |||
version: 0.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we want to put a version here not 0.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a drawback to use a version here: you need bump the version and helm dependency update
with every release.
The versioning usually makes sense when adding charts from other repos, with different lifecycles.
In our case, CRDs are always generated and copied under crds
folder: https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/hack/update_codegen.sh#L44-L46
There's a 1-1 match in the lifecycle for this chart. Thus, the version: 0.0.0
makes the trick to avoid extra steps.
@@ -0,0 +1,3 @@ | |||
apiVersion: v2 | |||
name: crds | |||
version: 0.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -0,0 +1,9 @@ | |||
# crds | |||
|
|||
![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
@@ -149,6 +149,8 @@ Chart parameters are available. | |||
|
|||
| Name | Type | Default | Description | | |||
| --------------------------------------------------- | ------ | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | |||
| `crds.install` | bool | false | Toggle to install and upgrade CRDs from a subchart. Make sure to use it with `--skip-crds` to avoid conflicts. [More info about limitations on CRDs in Helm 3](https://helm.sh/docs/topics/charts/#limitations-on-crds) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i'm not mistaken, I think the --skip-crds
flag is used for the crds
folder and not the separate helm chart. so I don't think that they're related. Please correct if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right about the flag 👍
The problem happens only when the chart is installed by the first time. In that scenario: helm install xxxx --skip-crds --set crds.install=true
(apologies for the oversimplification above)
Otherwise, Helm will install CRDs from both places. Again, this only happens the first time. Helm won't care about the CRDs folder during upgrades (nor uninstall)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you keeping an additional copy of the CRD in the /crds directory only for the initial installation of the chart?
I'm wondering if it might be too strict to always require using --skip-crds --set crds.install=true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My take was make the new approach optional. That is, if you do nothing, then the CRDs get installed as they are now.
By the other hand, if you want to taste the new approach, then --skip-crds --set crds.install=true
.
I wonder if this is a good compromise, or if we should go the sub-chart with CRDs approach in one single shot. WDYT @fmuyassarov
Regarding additional copies, all of them are automatically generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering whether we should standardize on using only crds.install=true
for all installations, including both first-time installs and upgrades. However, I'm concerned it might be too much to ask of users at this stage. For now, I think it’s better to keep it optional as you have it now.
Signed-off-by: cmontemuino <[email protected]>
81a7c2b
to
e5ed797
Compare
Signed-off-by: cmontemuino <[email protected]>
1588b58
to
cb5d03a
Compare
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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
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