mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Change trivial topology labels
In these cases the actual label key is incidental.
This commit is contained in:
parent
6c1a9bf177
commit
4068402459
@ -11061,8 +11061,8 @@ func TestValidateServiceCreate(t *testing.T) {
|
|||||||
tweakSvc: func(s *core.Service) {
|
tweakSvc: func(s *core.Service) {
|
||||||
s.Spec.TopologyKeys = []string{
|
s.Spec.TopologyKeys = []string{
|
||||||
"kubernetes.io/hostname",
|
"kubernetes.io/hostname",
|
||||||
"failure-domain.beta.kubernetes.io/zone",
|
"topology.kubernetes.io/zone",
|
||||||
"failure-domain.beta.kubernetes.io/region",
|
"topology.kubernetes.io/region",
|
||||||
v1.TopologyKeyAny,
|
v1.TopologyKeyAny,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -11090,7 +11090,7 @@ func TestValidateServiceCreate(t *testing.T) {
|
|||||||
s.Spec.TopologyKeys = []string{
|
s.Spec.TopologyKeys = []string{
|
||||||
"kubernetes.io/hostname",
|
"kubernetes.io/hostname",
|
||||||
v1.TopologyKeyAny,
|
v1.TopologyKeyAny,
|
||||||
"failure-domain.beta.kubernetes.io/zone",
|
"topology.kubernetes.io/zone",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
numErrs: 1,
|
numErrs: 1,
|
||||||
@ -11101,7 +11101,7 @@ func TestValidateServiceCreate(t *testing.T) {
|
|||||||
s.Spec.TopologyKeys = []string{
|
s.Spec.TopologyKeys = []string{
|
||||||
"kubernetes.io/hostname",
|
"kubernetes.io/hostname",
|
||||||
"kubernetes.io/hostname",
|
"kubernetes.io/hostname",
|
||||||
"failure-domain.beta.kubernetes.io/zone",
|
"topology.kubernetes.io/zone",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
numErrs: 1,
|
numErrs: 1,
|
||||||
|
@ -727,7 +727,7 @@ func BenchmarkTestPodTopologySpreadScore(b *testing.B) {
|
|||||||
{
|
{
|
||||||
name: "1000nodes/single-constraint-zone",
|
name: "1000nodes/single-constraint-zone",
|
||||||
pod: st.MakePod().Name("p").Label("foo", "").
|
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(),
|
Obj(),
|
||||||
existingPodsNum: 10000,
|
existingPodsNum: 10000,
|
||||||
allNodesNum: 1000,
|
allNodesNum: 1000,
|
||||||
@ -745,7 +745,7 @@ func BenchmarkTestPodTopologySpreadScore(b *testing.B) {
|
|||||||
{
|
{
|
||||||
name: "1000nodes/two-Constraints-zone-node",
|
name: "1000nodes/two-Constraints-zone-node",
|
||||||
pod: st.MakePod().Name("p").Label("foo", "").Label("bar", "").
|
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()).
|
SpreadConstraint(1, v1.LabelHostname, v1.ScheduleAnyway, st.MakeLabelSelector().Exists("bar").Obj()).
|
||||||
Obj(),
|
Obj(),
|
||||||
existingPodsNum: 10000,
|
existingPodsNum: 10000,
|
||||||
|
@ -441,7 +441,7 @@ func TestZoneSelectorSpreadPriority(t *testing.T) {
|
|||||||
|
|
||||||
buildNodeLabels := func(failureDomain string) map[string]string {
|
buildNodeLabels := func(failureDomain string) map[string]string {
|
||||||
labels := map[string]string{
|
labels := map[string]string{
|
||||||
v1.LabelFailureDomainBetaZone: failureDomain,
|
v1.LabelTopologyZone: failureDomain,
|
||||||
}
|
}
|
||||||
return labels
|
return labels
|
||||||
}
|
}
|
||||||
|
4
pkg/scheduler/internal/cache/cache_test.go
vendored
4
pkg/scheduler/internal/cache/cache_test.go
vendored
@ -1572,8 +1572,8 @@ func TestSchedulerCache_updateNodeInfoSnapshotList(t *testing.T) {
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: fmt.Sprintf("node-%d", i),
|
Name: fmt.Sprintf("node-%d", i),
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: fmt.Sprintf("region-%d", zone),
|
v1.LabelTopologyRegion: fmt.Sprintf("region-%d", zone),
|
||||||
v1.LabelFailureDomainBetaZone: fmt.Sprintf("zone-%d", zone),
|
v1.LabelTopologyZone: fmt.Sprintf("zone-%d", zone),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
40
pkg/scheduler/internal/cache/node_tree_test.go
vendored
40
pkg/scheduler/internal/cache/node_tree_test.go
vendored
@ -36,7 +36,7 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-1",
|
Name: "node-1",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-1",
|
v1.LabelTopologyRegion: "region-1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -45,7 +45,7 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-2",
|
Name: "node-2",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -54,8 +54,8 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-3",
|
Name: "node-3",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-1",
|
v1.LabelTopologyRegion: "region-1",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -64,8 +64,8 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-4",
|
Name: "node-4",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-1",
|
v1.LabelTopologyRegion: "region-1",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -74,8 +74,8 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-5",
|
Name: "node-5",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-1",
|
v1.LabelTopologyRegion: "region-1",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-3",
|
v1.LabelTopologyZone: "zone-3",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -84,8 +84,8 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-6",
|
Name: "node-6",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-2",
|
v1.LabelTopologyRegion: "region-2",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -94,8 +94,8 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-7",
|
Name: "node-7",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-2",
|
v1.LabelTopologyRegion: "region-2",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -104,8 +104,8 @@ var allNodes = []*v1.Node{
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-8",
|
Name: "node-8",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-2",
|
v1.LabelTopologyRegion: "region-2",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -282,8 +282,8 @@ func TestNodeTree_UpdateNode(t *testing.T) {
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-0",
|
Name: "node-0",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-1",
|
v1.LabelTopologyRegion: "region-1",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -302,8 +302,8 @@ func TestNodeTree_UpdateNode(t *testing.T) {
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-0",
|
Name: "node-0",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-1",
|
v1.LabelTopologyRegion: "region-1",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -318,8 +318,8 @@ func TestNodeTree_UpdateNode(t *testing.T) {
|
|||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "node-new",
|
Name: "node-new",
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
v1.LabelFailureDomainBetaRegion: "region-1",
|
v1.LabelTopologyRegion: "region-1",
|
||||||
v1.LabelFailureDomainBetaZone: "zone-2",
|
v1.LabelTopologyZone: "zone-2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -181,7 +181,7 @@ func TestTaintBasedEvictions(t *testing.T) {
|
|||||||
nodes = append(nodes, &v1.Node{
|
nodes = append(nodes, &v1.Node{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: fmt.Sprintf("node-%d", i),
|
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{},
|
Spec: v1.NodeSpec{},
|
||||||
Status: v1.NodeStatus{
|
Status: v1.NodeStatus{
|
||||||
|
@ -171,7 +171,7 @@
|
|||||||
countParam: $initNodes
|
countParam: $initNodes
|
||||||
nodeTemplatePath: config/node-default.yaml
|
nodeTemplatePath: config/node-default.yaml
|
||||||
labelNodePrepareStrategy:
|
labelNodePrepareStrategy:
|
||||||
labelKey: "failure-domain.beta.kubernetes.io/zone"
|
labelKey: "topology.kubernetes.io/zone"
|
||||||
labelValues: ["zone1"]
|
labelValues: ["zone1"]
|
||||||
- opcode: createPods
|
- opcode: createPods
|
||||||
countParam: $initPods
|
countParam: $initPods
|
||||||
@ -254,7 +254,7 @@
|
|||||||
countParam: $initNodes
|
countParam: $initNodes
|
||||||
nodeTemplatePath: config/node-default.yaml
|
nodeTemplatePath: config/node-default.yaml
|
||||||
labelNodePrepareStrategy:
|
labelNodePrepareStrategy:
|
||||||
labelKey: "failure-domain.beta.kubernetes.io/zone"
|
labelKey: "topology.kubernetes.io/zone"
|
||||||
labelValues: ["zone1"]
|
labelValues: ["zone1"]
|
||||||
- opcode: createPods
|
- opcode: createPods
|
||||||
countParam: $initPods
|
countParam: $initPods
|
||||||
|
@ -8,7 +8,7 @@ spec:
|
|||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
nodeSelectorTerms:
|
nodeSelectorTerms:
|
||||||
- matchExpressions:
|
- matchExpressions:
|
||||||
- key: failure-domain.beta.kubernetes.io/zone
|
- key: topology.kubernetes.io/zone
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- zone1
|
- zone1
|
||||||
|
@ -11,7 +11,7 @@ spec:
|
|||||||
- labelSelector:
|
- labelSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
color: blue
|
color: blue
|
||||||
topologyKey: failure-domain.beta.kubernetes.io/zone
|
topologyKey: topology.kubernetes.io/zone
|
||||||
namespaces: ["sched-test", "sched-setup"]
|
namespaces: ["sched-test", "sched-setup"]
|
||||||
containers:
|
containers:
|
||||||
- image: k8s.gcr.io/pause:3.2
|
- image: k8s.gcr.io/pause:3.2
|
||||||
|
@ -136,7 +136,7 @@ func BenchmarkSchedulingWaitForFirstConsumerPVs(b *testing.B) {
|
|||||||
}
|
}
|
||||||
basePod := makeBasePod()
|
basePod := makeBasePod()
|
||||||
testStrategy := testutils.NewCreatePodWithPersistentVolumeWithFirstConsumerStrategy(gceVolumeFactory, basePod)
|
testStrategy := testutils.NewCreatePodWithPersistentVolumeWithFirstConsumerStrategy(gceVolumeFactory, basePod)
|
||||||
nodeStrategy := testutils.NewLabelNodePrepareStrategy(v1.LabelFailureDomainBetaZone, "zone1")
|
nodeStrategy := testutils.NewLabelNodePrepareStrategy(v1.LabelTopologyZone, "zone1")
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
name := fmt.Sprintf("%vNodes/%vPods", test.nodes, test.existingPods)
|
name := fmt.Sprintf("%vNodes/%vPods", test.nodes, test.existingPods)
|
||||||
b.Run(name, func(b *testing.B) {
|
b.Run(name, func(b *testing.B) {
|
||||||
|
Loading…
Reference in New Issue
Block a user