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

Control cert-manager installation with a separate config value #972

Merged
merged 13 commits into from
Mar 16, 2024

Conversation

rkrzewski
Copy link

Fixes #971

@rkrzewski
Copy link
Author

I'd appreciate a review, @brokenpip3

@brokenpip3
Copy link
Collaborator

hei @rkrzewski thanks a lot for the PR, I will do a proper review asap.

In the mean time I saw that you bumped the certmanager dependency, however the previous maintainers have decided to add the certmanager crds into the crds folder in the chart: https://github.com/jenkinsci/kubernetes-operator/blob/master/chart/jenkins-operator/crds/cert-manager.crds.yaml

I tried previously to fix that by using some helm hooks but then I was forced to work on more urgent stuff and I planned to take a look on that after the 0.9.0 (which I will finally restart to handle in these days): #810

If you want to take a look it will be great, otherwise even if we put your new condition to off the helm chart will try to deploy the old certamanager crds anyway

@sbandaru08
Copy link

image
image

Version: 0.8.0-beta.2
We have our own certs that gets pulled by adding tls.secretName: xxxx-tst-wildcard. i tried running Version: 0.8.0-beta.2 by setting the webhook.false but still i get issues not sure if your fix can fix this issue. can you help me with it

@rkrzewski
Copy link
Author

If you want to take a look it will be great, otherwise even if we put your new condition to off the helm chart will try to deploy the old certamanager crds anyway

Sure I'll take look at it. @brokenpip3, do you think if the CRDs can be just wrapped in a conditional clause based on cert-manager.enabled value? Would that work?

@sbandaru08 if we sort out the above, it'll fix the problem you describe.

@sbandaru08
Copy link

Sure thank you

@brokenpip3
Copy link
Collaborator

Sure I'll take look at it. @brokenpip3, do you think if the CRDs can be just wrapped in a conditional clause based on cert-manager.enabled value? Would that work?

yes, but be aware that you can't have a go template inside the crds directory in helm, so you can't add guards, that's why I was trying with the helm hook

@rkrzewski
Copy link
Author

@brokenpip3 oh, I didn't know that. I've read up on https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ and maybe the "Method 2" would work? We could place the cert-manager CRDs into a separate sub-chart inside of jenkins-operator chart that use the same guard condition as cert-manager chart.

@brokenpip3
Copy link
Collaborator

@brokenpip3 oh, I didn't know that. I've read up on https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ and maybe the "Method 2" would work? We could place the cert-manager CRDs into a separate sub-chart inside of jenkins-operator chart that use the same guard condition as cert-manager chart.

Indeed could be a good tentative :)

@rkrzewski
Copy link
Author

@brokenpip3 I've moved the CRDs to separate subchart as discussed and it seems to work as expected:

helm template --include-crds --set cert-manager.enabled=false jenkins-operator .

generates manifests that include Jenkins CRD but none of cert-manager CRDs.

@brokenpip3
Copy link
Collaborator

brokenpip3 commented Mar 1, 2024

This is great, ty. I will try to find the time to review this PR during this weekend

@sbandaru08
Copy link

@brokenpip3 Just wanted to know to see when can this change live ?

@brokenpip3
Copy link
Collaborator

@brokenpip3 Just wanted to know to see when can this change live ?

I need to add some helm tests to be sure that this change will not destroy the current upgrade/install flow from both with/without validation webhook. It could take a couple of days or a couple of weeks, will depend on my free time

@rkrzewski
Copy link
Author

I need to add some helm tests
If this is something I could help you with, please let me know.

Copy link
Collaborator

@brokenpip3 brokenpip3 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@brokenpip3 brokenpip3 enabled auto-merge (squash) March 16, 2024 16:16
@brokenpip3 brokenpip3 merged commit cf49a4a into jenkinsci:master Mar 16, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm chart: enabling webhook causes an outdated version of cert-manager to be installed.
3 participants