-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Fix selector for shutting down Pods #7727
Conversation
@rikatz: This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The 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. |
/retest |
@longwuyuan the failure is real, I'm fixing here |
Co-authored-by: Jintao Zhang <tao12345666333@163.com>
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rikatz, tao12345666333 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 |
* Fix selector for shutting down Pods * Add autogenerated labels for daemonset in exception Co-authored-by: Jintao Zhang <tao12345666333@163.com> Co-authored-by: Jintao Zhang <tao12345666333@163.com>
* Fix selector for shutting down Pods * Add autogenerated labels for daemonset in exception Co-authored-by: Jintao Zhang <tao12345666333@163.com> Co-authored-by: Jintao Zhang <tao12345666333@163.com> Co-authored-by: Jintao Zhang <tao12345666333@163.com>
* Fix selector for shutting down Pods * Add autogenerated labels for daemonset in exception Co-authored-by: Jintao Zhang <tao12345666333@163.com> Co-authored-by: Jintao Zhang <tao12345666333@163.com>
What this PR does / why we need it:
Fixes the selector when checking if there are multiple Pods running Ingress.
Per previous code, it used the Pods labels to check if other Pods from the same application were running. This was necessary to not remove the IP from .status field before being sure no other Pod was running and serving.
The labels contained the pod-hash generated by ReplicaSet, but everytime someone does a rollout deployment a new hash was created, turning that selector always false and always removing the IP address from the .status.
This field is used by AWS and other cloud providers as the de-facto IP address/name to be used when publishing a new service on DNS.
We don't still verify yet if the list of Pods is properly running or not. While doing the implementation, it seems that selecting the phase of the Pod can lead into some wrong status reporting, so I decided to leave this field selector out of this PR so far.
EDIT: I have added some fallback, as not everybody is using the recommended labels
app.kubernetes.io
. The idea is just to drop the auto generated label "pod-template-hash" added by the replicaset or the statefulsetTypes of changes
Which issue/s this PR fixes
fixes #7047
How Has This Been Tested?
Folliwing the script provided in #7047 I could verify that when rolling out deployments, there wasn't a situation anymore when the IP address was removed and re-added. Now there is always an IP address there, unless there are set --replicas=0