diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go index d4dec3827ce..415f7c6b527 100644 --- a/pkg/apis/core/validation/validation_test.go +++ b/pkg/apis/core/validation/validation_test.go @@ -11061,8 +11061,8 @@ func TestValidateServiceCreate(t *testing.T) { tweakSvc: func(s *core.Service) { s.Spec.TopologyKeys = []string{ "kubernetes.io/hostname", - "failure-domain.beta.kubernetes.io/zone", - "failure-domain.beta.kubernetes.io/region", + "topology.kubernetes.io/zone", + "topology.kubernetes.io/region", v1.TopologyKeyAny, } }, @@ -11090,7 +11090,7 @@ func TestValidateServiceCreate(t *testing.T) { s.Spec.TopologyKeys = []string{ "kubernetes.io/hostname", v1.TopologyKeyAny, - "failure-domain.beta.kubernetes.io/zone", + "topology.kubernetes.io/zone", } }, numErrs: 1, @@ -11101,7 +11101,7 @@ func TestValidateServiceCreate(t *testing.T) { s.Spec.TopologyKeys = []string{ "kubernetes.io/hostname", "kubernetes.io/hostname", - "failure-domain.beta.kubernetes.io/zone", + "topology.kubernetes.io/zone", } }, numErrs: 1, diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go b/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go index 17f90d5074b..48933d6d1ec 100644 --- a/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go +++ b/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go @@ -727,7 +727,7 @@ func BenchmarkTestPodTopologySpreadScore(b *testing.B) { { name: "1000nodes/single-constraint-zone", pod: st.MakePod().Name("p").Label("foo", ""). - SpreadConstraint(1, v1.LabelFailureDomainBetaZone, v1.ScheduleAnyway, st.MakeLabelSelector().Exists("foo").Obj()). + SpreadConstraint(1, v1.LabelTopologyZone, v1.ScheduleAnyway, st.MakeLabelSelector().Exists("foo").Obj()). Obj(), existingPodsNum: 10000, allNodesNum: 1000, @@ -745,7 +745,7 @@ func BenchmarkTestPodTopologySpreadScore(b *testing.B) { { name: "1000nodes/two-Constraints-zone-node", pod: st.MakePod().Name("p").Label("foo", "").Label("bar", ""). - SpreadConstraint(1, v1.LabelFailureDomainBetaZone, v1.ScheduleAnyway, st.MakeLabelSelector().Exists("foo").Obj()). + SpreadConstraint(1, v1.LabelTopologyZone, v1.ScheduleAnyway, st.MakeLabelSelector().Exists("foo").Obj()). SpreadConstraint(1, v1.LabelHostname, v1.ScheduleAnyway, st.MakeLabelSelector().Exists("bar").Obj()). Obj(), existingPodsNum: 10000, diff --git a/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go b/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go index dc70262d72c..81f80d63651 100644 --- a/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go +++ b/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go @@ -441,7 +441,7 @@ func TestZoneSelectorSpreadPriority(t *testing.T) { buildNodeLabels := func(failureDomain string) map[string]string { labels := map[string]string{ - v1.LabelFailureDomainBetaZone: failureDomain, + v1.LabelTopologyZone: failureDomain, } return labels } diff --git a/pkg/scheduler/internal/cache/cache_test.go b/pkg/scheduler/internal/cache/cache_test.go index 4ed77d20b85..272270622e0 100644 --- a/pkg/scheduler/internal/cache/cache_test.go +++ b/pkg/scheduler/internal/cache/cache_test.go @@ -1572,8 +1572,8 @@ func TestSchedulerCache_updateNodeInfoSnapshotList(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("node-%d", i), Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: fmt.Sprintf("region-%d", zone), - v1.LabelFailureDomainBetaZone: fmt.Sprintf("zone-%d", zone), + v1.LabelTopologyRegion: fmt.Sprintf("region-%d", zone), + v1.LabelTopologyZone: fmt.Sprintf("zone-%d", zone), }, }, }) diff --git a/pkg/scheduler/internal/cache/node_tree_test.go b/pkg/scheduler/internal/cache/node_tree_test.go index de5a08376d1..4a4abe9e6c9 100644 --- a/pkg/scheduler/internal/cache/node_tree_test.go +++ b/pkg/scheduler/internal/cache/node_tree_test.go @@ -36,7 +36,7 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-1", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-1", + v1.LabelTopologyRegion: "region-1", }, }, }, @@ -45,7 +45,7 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-2", Labels: map[string]string{ - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -54,8 +54,8 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-3", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-1", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-1", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -64,8 +64,8 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-4", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-1", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-1", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -74,8 +74,8 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-5", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-1", - v1.LabelFailureDomainBetaZone: "zone-3", + v1.LabelTopologyRegion: "region-1", + v1.LabelTopologyZone: "zone-3", }, }, }, @@ -84,8 +84,8 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-6", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-2", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-2", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -94,8 +94,8 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-7", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-2", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-2", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -104,8 +104,8 @@ var allNodes = []*v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: "node-8", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-2", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-2", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -282,8 +282,8 @@ func TestNodeTree_UpdateNode(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "node-0", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-1", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-1", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -302,8 +302,8 @@ func TestNodeTree_UpdateNode(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "node-0", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-1", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-1", + v1.LabelTopologyZone: "zone-2", }, }, }, @@ -318,8 +318,8 @@ func TestNodeTree_UpdateNode(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "node-new", Labels: map[string]string{ - v1.LabelFailureDomainBetaRegion: "region-1", - v1.LabelFailureDomainBetaZone: "zone-2", + v1.LabelTopologyRegion: "region-1", + v1.LabelTopologyZone: "zone-2", }, }, }, diff --git a/test/integration/node/lifecycle_test.go b/test/integration/node/lifecycle_test.go index cffc3ccf1a1..871ab83bb9e 100644 --- a/test/integration/node/lifecycle_test.go +++ b/test/integration/node/lifecycle_test.go @@ -181,7 +181,7 @@ func TestTaintBasedEvictions(t *testing.T) { nodes = append(nodes, &v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("node-%d", i), - Labels: map[string]string{v1.LabelFailureDomainBetaRegion: "region1", v1.LabelFailureDomainBetaZone: "zone1"}, + Labels: map[string]string{v1.LabelTopologyRegion: "region1", v1.LabelTopologyZone: "zone1"}, }, Spec: v1.NodeSpec{}, Status: v1.NodeStatus{ diff --git a/test/integration/scheduler_perf/config/performance-config.yaml b/test/integration/scheduler_perf/config/performance-config.yaml index 5644f93ca33..2278319b0d7 100644 --- a/test/integration/scheduler_perf/config/performance-config.yaml +++ b/test/integration/scheduler_perf/config/performance-config.yaml @@ -171,7 +171,7 @@ countParam: $initNodes nodeTemplatePath: config/node-default.yaml labelNodePrepareStrategy: - labelKey: "failure-domain.beta.kubernetes.io/zone" + labelKey: "topology.kubernetes.io/zone" labelValues: ["zone1"] - opcode: createPods countParam: $initPods @@ -254,7 +254,7 @@ countParam: $initNodes nodeTemplatePath: config/node-default.yaml labelNodePrepareStrategy: - labelKey: "failure-domain.beta.kubernetes.io/zone" + labelKey: "topology.kubernetes.io/zone" labelValues: ["zone1"] - opcode: createPods countParam: $initPods diff --git a/test/integration/scheduler_perf/config/pod-with-node-affinity.yaml b/test/integration/scheduler_perf/config/pod-with-node-affinity.yaml index 813b949981a..352f7e91124 100644 --- a/test/integration/scheduler_perf/config/pod-with-node-affinity.yaml +++ b/test/integration/scheduler_perf/config/pod-with-node-affinity.yaml @@ -8,7 +8,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: failure-domain.beta.kubernetes.io/zone + - key: topology.kubernetes.io/zone operator: In values: - zone1 diff --git a/test/integration/scheduler_perf/config/pod-with-pod-affinity.yaml b/test/integration/scheduler_perf/config/pod-with-pod-affinity.yaml index 2b60af6822b..f523a1d8036 100644 --- a/test/integration/scheduler_perf/config/pod-with-pod-affinity.yaml +++ b/test/integration/scheduler_perf/config/pod-with-pod-affinity.yaml @@ -11,7 +11,7 @@ spec: - labelSelector: matchLabels: color: blue - topologyKey: failure-domain.beta.kubernetes.io/zone + topologyKey: topology.kubernetes.io/zone namespaces: ["sched-test", "sched-setup"] containers: - image: k8s.gcr.io/pause:3.2 diff --git a/test/integration/scheduler_perf/scheduler_perf_legacy_test.go b/test/integration/scheduler_perf/scheduler_perf_legacy_test.go index 3438ec25fd5..f482034ab50 100644 --- a/test/integration/scheduler_perf/scheduler_perf_legacy_test.go +++ b/test/integration/scheduler_perf/scheduler_perf_legacy_test.go @@ -136,7 +136,7 @@ func BenchmarkSchedulingWaitForFirstConsumerPVs(b *testing.B) { } basePod := makeBasePod() testStrategy := testutils.NewCreatePodWithPersistentVolumeWithFirstConsumerStrategy(gceVolumeFactory, basePod) - nodeStrategy := testutils.NewLabelNodePrepareStrategy(v1.LabelFailureDomainBetaZone, "zone1") + nodeStrategy := testutils.NewLabelNodePrepareStrategy(v1.LabelTopologyZone, "zone1") for _, test := range tests { name := fmt.Sprintf("%vNodes/%vPods", test.nodes, test.existingPods) b.Run(name, func(b *testing.B) {