Skip to content

install CRDs with helm - #2646

Closed
drewwells wants to merge 1 commit into
cert-manager:masterfrom
drewwells:feature/fixHelmInstall
Closed

drewwells wants to merge 1 commit into
cert-manager:masterfrom
drewwells:feature/fixHelmInstall

Conversation

@drewwells

Copy link
Copy Markdown

helm has patterns for installing CRDs that are followed by all
other charts. This brings cert-manager inline with the rest
of the community.

What this PR does / why we need it:

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

cert-manager can finally be installed with helm

@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Mar 3, 2020
@jetstack-bot

Copy link
Copy Markdown
Contributor

Hi @drewwells. Thanks for your PR.

I'm waiting for a jetstack or cert-manager 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.

Details

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/test-infra repository.

@jetstack-bot jetstack-bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/deploy Indicates a PR modifies deployment configuration labels Mar 3, 2020
@jetstack-bot
jetstack-bot requested a review from JoshVanL March 3, 2020 23:47
@jetstack-bot jetstack-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 3, 2020
@jetstack-bot
jetstack-bot requested a review from munnerz March 3, 2020 23:47
@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: drewwells
To complete the pull request process, please assign joshvanl
You can assign the PR to them by writing /assign @joshvanl in a comment when ready.

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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

helm has patterns for installing CRDs that are followed by all
other charts. This brings cert-manager inline with the rest
of the community.

Signed-off-by: Drew Wells <[email protected]>
@drewwells
drewwells force-pushed the feature/fixHelmInstall branch from ea08390 to 43b29de Compare March 3, 2020 23:48
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Mar 3, 2020
name: clusterissuers.cert-manager.io
annotations:
cert-manager.io/inject-ca-from-secret: cert-manager/cert-manager-webhook-tls
helm.sh/hook: crd-install

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hook causes Helm to not perform upgrades on CRD resources after they have been installed, i.e. once installed, they are never modified again.

This is not acceptable for our project, as we make changes to our CRDs in each release.

More info can be found here: helm/helm#6243

Until the Helm team change this and implement actual full lifecycle management for CRDs, there is no way that we can support a change like this.

It's a real shame, but it will absolutely trip users up in future versions and we don't want to go through that same user pain again (v0.4-v0.5 resulted in everyone having all their CRDs deleted, and left Helm installations in a broken state due to this annotation).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrades are disabled by design as mentioned in the PR and reasons given there. CRD upgrades involve deleting the CRD, deleting all the CRs on the cluster then installing a new CRD. Telling people that we don't offer CRD installs as part of a chart is orthogonal to that technical decision.

Helm has lifecycle management for installing a CRD and deleting one. This chart has disabled those lifecycles. The fact that helm has taken user feedback about CRD updates being a dangerous process is a good thing. You are in safe hands with the Helm community.

Now what I can not understand is why the community has asked for this feature on multiple occasions and get blocked with comments like this. Every chart must be installable with helm, having out of band processes outside of helm makes for a poor user experience.

Examples
helm/charts#9166
#1255 (comment)
#1536

I could no doubt find dozens of other comments like this if I spent more than 5mins looking.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrades are disabled by design as mentioned in the PR and reasons given there. CRD upgrades involve deleting the CRD, deleting all the CRs on the cluster then installing a new CRD. Telling people that we don't offer CRD installs as part of a chart is orthogonal to that technical decision.

This is not true. Upgrading a CRD does not require deleting all instances of that CRD and re-installing them. This is only true if a publisher/author makes a backwards incompatible change to their API schema, which is (naturally) not supported, and is not recommended in any way by #sig-api-machinery.

We have taken a lot of time as a project to set up the necessary infrastructure to support seamless upgrades of CRDs, with the addition of the 'conversion webhook' which will be a part of the v0.14 release (an alpha for which will be available today).

Helm has lifecycle management for installing a CRD and deleting one

On the contrary, beyond "installing once", Helm doesn't have lifecycle management for CRDs. It simply opts to not do anything with them beyond initial install, which is not usable for us as authors of a CRD consumed by many, as part of a project that (naturally) accepts new features and thus, backwards compatible API schema changes.

The fact that helm has taken user feedback about CRD updates being a dangerous process is a good thing.

I don't think I agree 😄 I think there's a lot more Helm could/should do to manage CRDs (notably, just treating them like regular resources).

If the Helm community has come to the conclusion that CRD resources should not be upgraded after first installation, or if they are upgraded, that they are completely uninstalled and re-installed, then I would absolutely like to challenge this status-quo as it is incorrect, and it is tangential to the work #sig-api-machinery has been doing over the years to make CRDs first-class citizens in the Kubernetes apiserver.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened helm/helm#7735 in the Helm repository to discuss this further 😄

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂ okay - if you have anything to contribute to the actual Helm issue I've linked above that will allow us to add them to the chart in the actual upstream repo here, please add a comment.

Otherwise, please don't open issues here if something goes wrong after you've gone against our guidance 😅

@drewwells

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/deploy Indicates a PR modifies deployment configuration dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants