Skip to content
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

Note on missing/incorrect labels and scheduler behaviour with pod anti-affinity #8973

Merged
merged 1 commit into from
Jul 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/en/docs/concepts/configuration/assign-pod-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ in the section [Interlude: built-in node labels](#interlude-built-in-node-labels
processing which can slow down scheduling in large clusters significantly. We do
not recommend using them in clusters larger than several hundred nodes.

**Note:** Pod anti-affinity requires nodes to be consistently labelled, i.e. every node in the cluster must have an appropriate label matching `topologyKey`. If some or all nodes are missing the speficied `topologyKey` label, it can lead to unintended behavior.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this applies to both pod affinity and pod anti-affinity, although the unexpected behavior is different.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: start the sentence with "Inter-pod affinity requires..." or "Pod affinity and anti-affinity require..."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it with pod affinity and there it works as expected, i.e. a missing topologyKey label does not schedule the (second) pod with affinity configured. That's why I only pointed out the "unexpected behavior" for anti-affinity.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think failing to schedule the second pod as you described is unexpected behavior. Suppose pod A is on Node 1, and pod B has required affinity for pod A. If Node 1 has capacity, the expected behavior is for pod B to schedule.


As with node affinity, there are currently two types of pod affinity and anti-affinity, called `requiredDuringSchedulingIgnoredDuringExecution` and
`preferredDuringSchedulingIgnoredDuringExecution` which denote "hard" vs. "soft" requirements.
See the description in the node affinity section earlier.
Expand Down