-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Controller: Correctly identify other pods on shutdown. #13444
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: DerekTBrown 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 |
Welcome @DerekTBrown! |
Hi @DerekTBrown. Thanks for your PR. I'm waiting for a kubernetes 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. |
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.
Gonna review the Go code later.
/retitle Controller: Correctly identify other pods on shutdown.
/triage accepted
/kind feature
/priority backlog
/hold
What we are looking for here is basically a way to determine all the other pods targeted by either the Deployment or the DaemonSet, right? Why don't we hand in the selector labels used in the |
Reviewing the code once again, I'm asking myself if the whole stuff in |
Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
As I understand it, ingress-nginx/internal/ingress/status/status.go Lines 83 to 89 in eba4c5b
I think we still need to do this even if we have a single pod / leader election disabled, since on initial ingress creation, the user will see the ingress go from having no IPs to having a single pod IP as a result of this function. However, I agree we probably should have a separate abstraction for whether a given ingress-nginx pod is a leader. If leader-election is disabled, the pod should just assume its a leader. |
If leader election is disabled, the user needs to prevent multiple concurrent ingress-nginxes from running concurrently, otherwise concurrent modifications can happen. I thus assume the user is running only a single pod. The existing + new logic works correctly under this assumption; no pods have the same election id, so on shutdown it treats itself as the last remaining pod. |
What this PR does / why we need it:
electionID
. We expect a pod to tear down an ingress iff all pods with the same electionID have gone away (i.e. meaning there will be no future successful master election).Types of changes
This is a breaking change in two respects:
Which issue/s this PR fixes
--update-status-on-shutdown
for external DNS #18771How Has This Been Tested?
helm chart
to validate the new label is defined.status.go
component to validate the pod finding behavior.Checklist:
Footnotes
See: https://github.com/kubernetes/ingress-nginx/issues/11087#issuecomment-2712118775 ↩ ↩2 ↩3