From ac3d7d5642f4cf3d5d1d4e7b5d76812cba2b9992 Mon Sep 17 00:00:00 2001 From: Aldo Culquicondor Date: Mon, 2 Nov 2020 11:03:47 -0500 Subject: [PATCH] Graduate default pod topology spread to beta --- .../pods/pod-topology-spread-constraints.md | 23 +++++++++++++++---- .../feature-gates.md | 3 ++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/content/en/docs/concepts/workloads/pods/pod-topology-spread-constraints.md b/content/en/docs/concepts/workloads/pods/pod-topology-spread-constraints.md index 28b844d474..4b33db8703 100644 --- a/content/en/docs/concepts/workloads/pods/pod-topology-spread-constraints.md +++ b/content/en/docs/concepts/workloads/pods/pod-topology-spread-constraints.md @@ -284,8 +284,6 @@ There are some implicit conventions worth noting here: ### Cluster-level default constraints -{{< feature-state for_k8s_version="v1.19" state="beta" >}} - It is possible to set default topology spread constraints for a cluster. Default topology spread constraints are applied to a Pod if, and only if: @@ -312,6 +310,7 @@ profiles: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: ScheduleAnyway + defaultingType: List ``` {{< note >}} @@ -324,9 +323,9 @@ using default constraints for `PodTopologySpread`. #### Internal default constraints -{{< feature-state for_k8s_version="v1.19" state="alpha" >}} +{{< feature-state for_k8s_version="v1.20" state="beta" >}} -When you enable the `DefaultPodTopologySpread` feature gate, the +With the `DefaultPodTopologySpread` feature gate, enabled by default, the legacy `SelectorSpread` plugin is disabled. kube-scheduler uses the following default topology constraints for the `PodTopologySpread` plugin configuration: @@ -353,6 +352,22 @@ The `PodTopologySpread` plugin does not score the nodes that don't have the topology keys specified in the spreading constraints. {{< /note >}} +If you don't want to use the default Pod spreading constraints for your cluster, +you can disable those defaults by setting `defaultingType` to `List` and leaving +empty `defaultConstraints` in the `PodTopologySpread` plugin configuration: + +```yaml +apiVersion: kubescheduler.config.k8s.io/v1beta1 +kind: KubeSchedulerConfiguration + +profiles: + - pluginConfig: + - name: PodTopologySpread + args: + defaultConstraints: [] + defaultingType: List +``` + ## Comparison with PodAffinity/PodAntiAffinity In Kubernetes, directives related to "Affinity" control how Pods are diff --git a/content/en/docs/reference/command-line-tools-reference/feature-gates.md b/content/en/docs/reference/command-line-tools-reference/feature-gates.md index a5ffe35a93..9b13e34d69 100644 --- a/content/en/docs/reference/command-line-tools-reference/feature-gates.md +++ b/content/en/docs/reference/command-line-tools-reference/feature-gates.md @@ -85,7 +85,8 @@ different Kubernetes components. | `CustomCPUCFSQuotaPeriod` | `false` | Alpha | 1.12 | | | `CustomResourceDefaulting` | `false` | Alpha| 1.15 | 1.15 | | `CustomResourceDefaulting` | `true` | Beta | 1.16 | | -| `DefaultPodTopologySpread` | `false` | Alpha | 1.19 | | +| `DefaultPodTopologySpread` | `false` | Alpha | 1.19 | 1.19 | +| `DefaultPodTopologySpread` | `true` | Beta | 1.20 | | | `DevicePlugins` | `false` | Alpha | 1.8 | 1.9 | | `DevicePlugins` | `true` | Beta | 1.10 | | | `DisableAcceleratorUsageMetrics` | `false` | Alpha | 1.19 | 1.19 |