Skip to content

Commit

Permalink
assign-pod-node: pod affinity can't apply to all namespaces (#9876)
Browse files Browse the repository at this point in the history
  • Loading branch information
glasser authored and k8s-ci-robot committed Aug 20, 2018
1 parent 4c581ee commit 6e92a70
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions content/en/docs/concepts/configuration/assign-pod-node.md
Expand Up @@ -167,7 +167,7 @@ Inter-pod affinity and anti-affinity were introduced in Kubernetes 1.4.
Inter-pod affinity and anti-affinity allow you to constrain which nodes your pod is eligible to be scheduled *based on
labels on pods that are already running on the node* rather than based on labels on nodes. The rules are of the form "this pod should (or, in the case of
anti-affinity, should not) run in an X if that X is already running one or more pods that meet rule Y". Y is expressed
as a LabelSelector with an associated list of namespaces (or "all" namespaces); unlike nodes, because pods are namespaced
as a LabelSelector with an associated list of namespaces; unlike nodes, because pods are namespaced
(and therefore the labels on pods are implicitly namespaced),
a label selector over pod labels must specify which namespaces the selector should apply to. Conceptually X is a topology domain
like node, rack, cloud provider zone, cloud provider region, etc. You express it using a `topologyKey` which is the
Expand Down Expand Up @@ -224,8 +224,7 @@ empty `topologyKey` is not allowed.

In addition to `labelSelector` and `topologyKey`, you can optionally specify a list `namespaces`
of namespaces which the `labelSelector` should match against (this goes at the same level of the definition as `labelSelector` and `topologyKey`).
If omitted, it defaults to the namespace of the pod where the affinity/anti-affinity definition appears.
If defined but empty, it means "all namespaces".
If omitted or empty, it defaults to the namespace of the pod where the affinity/anti-affinity definition appears.

All `matchExpressions` associated with `requiredDuringSchedulingIgnoredDuringExecution` affinity and anti-affinity
must be satisfied for the pod to be scheduled onto a node.
Expand Down

0 comments on commit 6e92a70

Please sign in to comment.