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

helm: use Helm hooks instead of Job unique name #23102

Merged
merged 2 commits into from Feb 6, 2023

Conversation

sathieu
Copy link
Contributor

@sathieu sathieu commented Jan 16, 2023

Without this, ArgoCD (and other Gitops tools) thinks there is a diff.

See https://helm.sh/docs/topics/charts_hooks/.

helm: use Helm hooks instead of Job unique name

@sathieu sathieu requested review from a team as code owners January 16, 2023 06:10
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 16, 2023
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Jan 16, 2023
Copy link
Member

@gandro gandro 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 the PR, I did some local testing and this seems to work nicely!

For anyone curious how this works: Thanks to the job being a hook, Helm will not treat it as part oft the release. Any existing job will be removed by Helm after an upgrade or install due to the "helm.sh/hook-delete-policy": before-hook-creation default value.

Could you also update the clustermesh certificate generation? Thanks

{{/*
Because Kubernetes job specs are immutable, Helm will fail patch this job if
the spec changes between releases. To avoid breaking the upgrade path, we
generate a name for the job here which is based on the checksum of the spec.
This will cause the name of the job to change if its content changes,
and in turn cause Helm to do delete the old job and replace it with a new one.
*/}}
{{- $jobSpec := include "clustermesh-apiserver-generate-certs.job.spec" . -}}
{{- $checkSum := $jobSpec | sha256sum | trunc 10 -}}

@gandro gandro added release-note/minor This PR changes functionality that users may find relevant to operating Cilium. area/helm Impacts helm charts and user deployment experience and removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jan 16, 2023
generate a name for the job here which is based on the checksum of the spec.
This will cause the name of the job to change if its content changes,
and in turn cause Helm to do delete the old job and replace it with a new one.
*/}}
{{- $jobSpec := include "hubble-generate-certs.job.spec" . -}}
{{- $checkSum := $jobSpec | sha256sum | trunc 10 -}}
Copy link
Member

Choose a reason for hiding this comment

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

Ah, noticed too late. Please also remove this line, since it's not used anymore. And we can probably inline $jobSpec too, now that there is only one use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@sathieu
Copy link
Contributor Author

sathieu commented Jan 16, 2023

@gandro. Thanks for your review. I've addressed your comments. Backto you!

Could you also update the clustermesh certificate generation? Thanks

Done.

Please also remove this line, since it's not used anymore. And we can probably inline $jobSpec too, now that there is only one use.

Done.

@sathieu sathieu requested review from gandro and removed request for tommyp1ckles January 16, 2023 13:11
Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

Thanks!

I've started the first stage CI. Let's also ensure that we get reviews from sig-k8s.

@aanm
Copy link
Member

aanm commented Jan 29, 2023

@gandro are there any implications on upgrading?

Adding @kaworu as reviewer just for a FYI on the hubble part.

@aanm
Copy link
Member

aanm commented Jan 29, 2023

/test

Job 'Cilium-PR-K8s-1.24-kernel-5.4' failed:

Click to show.

Test Name

K8sDatapathConfig Encapsulation Check connectivity with transparent encryption, VXLAN, and endpoint routes

Failure Output

FAIL: Kubernetes DNS did not become ready in time

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.24-kernel-5.4 so I can create one.

Job 'Cilium-PR-K8s-1.25-kernel-4.19' failed:

Click to show.

Test Name

K8sDatapathConfig Encapsulation Check connectivity with transparent encryption, VXLAN, and endpoint routes

Failure Output

FAIL: Kubernetes DNS did not become ready in time

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.25-kernel-4.19 so I can create one.

Copy link
Member

@kaworu kaworu left a comment

Choose a reason for hiding this comment

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

Thanks @sathieu nice cleanup!

@gandro
Copy link
Member

gandro commented Jan 30, 2023

@gandro are there any implications on upgrading?

As far as I understand, no. At least not as long as helm upgrade is used (for users who maintain their own YAML based on helm template it will depend on their tooling).

@sathieu
Copy link
Contributor Author

sathieu commented Feb 1, 2023

This PR has 3 approvals, however the CI is failing for unrelated reason. Anything missing to merge?

@tommyp1ckles
Copy link
Contributor

@sathieu looks like some image pull backoff issues in k8s testing. It's been a couple weeks since the CI images where built so the images probably just expired - I'm just going to rerun the tests.

@tommyp1ckles
Copy link
Contributor

/test

@pchaigno
Copy link
Member

pchaigno commented Feb 1, 2023

/test

@tommyp1ckles Note that command doesn't rerun the image builds. You need to do that manually (I will).

sathieu and others added 2 commits February 2, 2023 17:34
See https://helm.sh/docs/topics/charts_hooks/.

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
@pchaigno
Copy link
Member

pchaigno commented Feb 2, 2023

@sathieu Was there a merge conflict forcing to rebase? JFYI, we need to rerun the full test suite after each rebase.

@pchaigno
Copy link
Member

pchaigno commented Feb 2, 2023

/test

@sathieu
Copy link
Contributor Author

sathieu commented Feb 2, 2023

@pchaigno Sorry, I added a commit for #23102 (comment), and rebased for clean history. I thought a merge would require a /retest too...

@kaworu
Copy link
Member

kaworu commented Feb 3, 2023

Looks like k8s-1.26-kernel-net-next CI run hit #20723

@kaworu
Copy link
Member

kaworu commented Feb 3, 2023

/test-1.26-net-next

@kaworu
Copy link
Member

kaworu commented Feb 3, 2023

/ci-l4lb

@kaworu
Copy link
Member

kaworu commented Feb 6, 2023

/ci-verifier

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 6, 2023
@pchaigno
Copy link
Member

pchaigno commented Feb 6, 2023

@kaworu Please provide a rationale when restarting tests. We want to ensure that we don't miss new flakes (i.e., that we create flake issues as soon as the flakes as discovered).

@pchaigno pchaigno merged commit 9af18a1 into cilium:master Feb 6, 2023
@kaworu
Copy link
Member

kaworu commented Feb 7, 2023

@pchaigno both ci-l4lb and ci-verifier were in a "waiting status" pending state and didn't report anything. I was assuming they didn't run at all, but is there any way to get info?

@pchaigno
Copy link
Member

pchaigno commented Feb 7, 2023

Ok, probably some blip caused the job triggering to fail for those. Still good to mention so the TopHat doesn't get scared when they see a lot of reruns 😸

@sathieu
Copy link
Contributor Author

sathieu commented Feb 20, 2023

Unfortunately, it's not in 1.13.0. Any chance to have this backported?

@kaworu
Copy link
Member

kaworu commented Feb 28, 2023

Seems safe enough to backport to v1.13, @gandro do you agree?

@gandro
Copy link
Member

gandro commented Feb 28, 2023

I'd like to avoid such changes in patch releases, there is the potential danger of it breaking peoples workflow (e.g. if they manually use helm template), which is why I added the minor release note label.

Since this is not a bugfix, I don't think it satisfies the Backport Criteria for Current Minor Release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm Impacts helm charts and user deployment experience kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants