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 inter-pod anti-affinity check to consider a pod a match when all the anti-affinity terms match #62715

Merged
merged 2 commits into from Apr 18, 2018

Conversation

Projects
None yet
4 participants
@bsalamat
Contributor

bsalamat commented Apr 17, 2018

What this PR does / why we need it:
Inter-pod anti-affinity check used to incorrectly consider a pod a match when any of the anti-affinity terms matched the pod. This PR fixes the logic to consider a pod a match when all the terms match the pod.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #62567

Special notes for your reviewer:

Release note:

Fix inter-pod anti-affinity check to consider a pod a match when all the anti-affinity terms match.

/sig scheduling

bsalamat added some commits Apr 15, 2018

@bsalamat

This comment has been minimized.

Contributor

bsalamat commented Apr 17, 2018

cc @wackxu

@dixudx

This comment has been minimized.

Member

dixudx commented Apr 17, 2018

@bsalamat IIUC I think this PR could be combined with #62591, which is aimed to the similar issue and easy to be cherry-picked.

They are both fixing pod affinity/anti-affinity issues. One is in raw affinity/anti-affinity terms and the other is in topology terms, which will match all the affinity/anti-affinity terms in topology side.

Also the description/title of this PR is misleading. This PR is focusing more on topology side.

@bsalamat

This comment has been minimized.

Contributor

bsalamat commented Apr 17, 2018

@bsalamat IIUC I think this PR could be combined with #62591, which is aimed to the similar issue and easy to be cherry-picked.
They are both fixing pod affinity/anti-affinity issues. One is in raw affinity/anti-affinity terms and the other is in topology terms, which will match all the affinity/anti-affinity terms in topology side.

PR #62591 was targeting a different, but similar problem. That PR was intended to fix self-affinity issue, although I also fixed the anti-affinity issue in our slow path as well. This PR cannot be back-ported as it touches code that is mostly added in #62211. We could possibly back-port #62591, but even that one cannot be back-ported verbatim and needs changes.

Also the description/title of this PR is misleading. This PR is focusing more on topology side.

This PR actually fixes the issue mentioned in the title. The anti-affinity matching algorithm had a bug. The bug was not in checking topology; it was in how we combined the results of multiple anti-affinity terms.

@dixudx

This comment has been minimized.

Member

dixudx commented Apr 18, 2018

/lgtm

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Apr 18, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bsalamat, dixudx

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Apr 18, 2018

Automatic merge from submit-queue (batch tested with PRs 62761, 62715). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit 98968c3 into kubernetes:master Apr 18, 2018

15 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation bsalamat authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment