-
Notifications
You must be signed in to change notification settings - Fork 2.2k
BUGFIX: cainjector leaderelection defaults are missing #6816
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
BUGFIX: cainjector leaderelection defaults are missing #6816
Conversation
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
/cherrypick release-1.14 |
@inteon: once the present PR merges, I will cherry-pick it on top of release-1.14 in a new PR and assign it to you. In response to this:
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. |
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
/retest |
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.
- Please demonstrate that you've tested this.
- Show that the command line
--help
displays these defaults. - Consider documenting the defaults in https://cert-manager.io/docs/reference/api-docs/#cainjector.config.cert-manager.io/v1alpha1.LeaderElectionConfig (here or in a future PR)
- Write an issue with some ideas about how we can prevent the leader election being accidentally disabled in future. Perhaps there should be an E2E test which checks the status of the lease resource? Or perhaps there should be a
cmctl check deployment
command which we could run in the E2E test setup?
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 for updating the PR description and creating those followup issues.
I haven't run this locally, but I'll run the best-practice E2E tests which runs 2 replicas of the cainjector and take a look at the logs of the leader and non-leader.
/test pull-cert-manager-master-e2e-v1-28-bestpractice-install
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.
Ok. Leader election does seem to be working. The leader logs that it got the lease and creates an event.
Leader
2024-03-06T10:03:44.835697696Z stderr F I0306 10:03:44.835555 1 leaderelection.go:250] attempting to acquire leader lease kube-system/cert-manager-cainjector-leader-election...
2024-03-06T10:03:44.846209174Z stderr F I0306 10:03:44.844625 1 leaderelection.go:260] successfully acquired lease kube-system/cert-manager-cainjector-leader-election
...
2024-03-06T10:03:44.846438134Z stderr F I0306 10:03:44.845959 1 recorder.go:104] "cert-manager-cainjector-569fb9bb86-7tn59_39ca634f-499b-4eb8-bb0c-7703731830aa became leader" logger="cert-manager.events" type="Normal" object={"kind":"Lease","namespace":"kube-system","name":"cert-manager-cainjector-leader-election","uid":"0a30f665-0ba4-4aa5-9c8e-eb4c9f7292e4","apiVersion":"coordination.k8s.io/v1","resourceVersion":"1972"} reason="LeaderElection"
2024-03-06T10:03:45.108960288Z stderr F I0306 10:03:45.108857 1 leaderelection.go:250] attempting to acquire leader lease kube-system/cert-manager-cainjector-leader-election...
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wallrj The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@inteon: new pull request created: #6819 In response to this:
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. |
In #6345, I forgot to add the defaults for the cainjector leaderelection options.
The original defaults can be found here: https://github.com/cert-manager/cert-manager/blob/ba6268135d0f2ebea5f8eb29a57934f1acae15e2/internal/cmd/util/defaults.go.
Fixes #6808
Kind
/kind bug
Release Note