Skip to content

Commit

Permalink
Merge pull request #35044 from kerthcet/feat/topology-policy
Browse files Browse the repository at this point in the history
Document the new NodeInclusionPolicyInPodTopologySpread feature gate
  • Loading branch information
k8s-ci-robot authored Aug 17, 2022
2 parents 58b1994 + 3b0b5b9 commit a98137b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
whenUnsatisfiable: <string>
labelSelector: <object>
matchLabelKeys: <list> # optional; alpha since v1.25
nodeAffinityPolicy: [Honor|Ignore] # optional; alpha since v1.25
nodeTaintsPolicy: [Honor|Ignore] # optional; alpha since v1.25
### other Pod fields go here
```

Expand Down Expand Up @@ -148,6 +150,33 @@ your cluster. Those fields are:
in order to use it.
{{< /note >}}

- **nodeAffinityPolicy** indicates how we will treat Pod's nodeAffinity/nodeSelector
when calculating pod topology spread skew. Options are:
- Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.

If this value is null, the behavior is equivalent to the Honor policy.

{{< note >}}
The `nodeAffinityPolicy` is an alpha-level field added in 1.25. You have to enable the
`NodeInclusionPolicyInPodTopologySpread` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
in order to use it.
{{< /note >}}

- **nodeTaintsPolicy** indicates how we will treat node taints when calculating
pod topology spread skew. Options are:
- Honor: nodes without taints, along with tainted nodes for which the incoming pod
has a toleration, are included.
- Ignore: node taints are ignored. All nodes are included.

If this value is null, the behavior is equivalent to the Ignore policy.

{{< note >}}
The `nodeTaintsPolicy` is an alpha-level field added in 1.25. You have to enable the
`NodeInclusionPolicyInPodTopologySpread` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
in order to use it.
{{< /note >}}

When a Pod defines more than one `topologySpreadConstraint`, those constraints are
combined using a logical AND operation: the kube-scheduler looks for a node for the incoming Pod
that satisfies all the configured constraints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ different Kubernetes components.
| `MixedProtocolLBService` | `false` | Alpha | 1.20 | 1.23 |
| `MixedProtocolLBService` | `true` | Beta | 1.24 | |
| `NetworkPolicyStatus` | `false` | Alpha | 1.24 | |
| `NodeInclusionPolicyInPodTopologySpread` | `false` | Alpha | 1.25 | |
| `NodeSwap` | `false` | Alpha | 1.22 | |
| `NodeOutOfServiceVolumeDetach` | `false` | Alpha | 1.24 | |
| `OpenAPIEnums` | `false` | Alpha | 1.23 | 1.23 |
Expand Down Expand Up @@ -1041,6 +1042,9 @@ Each feature gate is designed for enabling/disabling a specific feature:
- `NetworkPolicyEndPort`: Enable use of the field `endPort` in NetworkPolicy objects,
allowing the selection of a port range instead of a single port.
- `NetworkPolicyStatus`: Enable the `status` subresource for NetworkPolicy objects.
- `NodeInclusionPolicyInPodTopologySpread`: Enable using `nodeAffinityPolicy` and `nodeTaintsPolicy` in
[Pod topology spread constraints](/docs/concepts/scheduling-eviction/topology-spread-constraints/)
when calculating pod topology spread skew.
- `NodeDisruptionExclusion`: Enable use of the Node label `node.kubernetes.io/exclude-disruption`
which prevents nodes from being evacuated during zone failures.
- `NodeLease`: Enable the new Lease API to report node heartbeats, which could be used as a node health signal.
Expand Down

0 comments on commit a98137b

Please sign in to comment.