-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Disable matching on few selectors. Remove duplicates. #72801
Disable matching on few selectors. Remove duplicates. #72801
Conversation
Hi @Ramyak. 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/test-infra repository. |
/ok-to-test |
a50dc68
to
a56a7de
Compare
/test pull-kubernetes-e2e-gce-100-performance |
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, @Ramyak for the fix. Could you please address my comment?
a56a7de
to
f2de2b6
Compare
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.
This PR addresses "Problem 2" of #71327, but it is a diversion from the existing behavior. Our existing code gets a union of all pods that match any of the selectors. This PR changes the union to an intersection operator. While I don't have a particular scenario in mind that would break if someone uses a standard collection, it is easy to find scenarios where pods with custom labels will no longer spread properly after this change. For that reason, I would like to think a bit more about this PR before I can approve it.
f2de2b6
to
c21c57e
Compare
c21c57e
to
339ce0e
Compare
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.
/approve
I thought more about this change and given that the pattern mentioned in the issue can happen for many users, I decided to approve it.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, Ramyak 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 |
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
/test pull-kubernetes-e2e-gce-100-performance |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Problem: When there are 2 selectors(eg: service and replication controller), it is sufficient to match any one selector for distribution. This creates imbalance [selector match code].
Pods from previous deploys matches
service selector
and are counted when distributing pods across zones/nodes (Even though they do not matchreplicaset selector
) . These pods will be deleted. After the deploy completes, the cluster is imbalanced - by zone and/or pods per node.Fix: All selectors must match pods. Partial matches are still allowed.
Which issue(s) this PR fixes:
Fixes #71327
Special notes for your reviewer:
#71328
Splitting this into 2 reviews.
Does this PR introduce a user-facing change?:
/sig scheduling