mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
scheduler_perf: allow users to specify default pod and node specs (#101799)
* scheduler_perf: default pod and node spec * Fix: un-support DefaultNodeTemplatePath
This commit is contained in:
parent
f045fb688f
commit
b0d47cb380
@ -1,13 +1,12 @@
|
||||
- name: SchedulingBasic
|
||||
defaultPodTemplatePath: config/pod-default.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-default.yaml
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-default.yaml
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
- name: 500Nodes
|
||||
@ -22,6 +21,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingPodAntiAffinity
|
||||
defaultPodTemplatePath: config/pod-with-pod-anti-affinity.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -32,11 +32,9 @@
|
||||
count: 2
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-with-pod-anti-affinity.yaml
|
||||
namespace: sched-0
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-with-pod-anti-affinity.yaml
|
||||
collectMetrics: true
|
||||
namespace: sched-1
|
||||
workloads:
|
||||
@ -52,15 +50,14 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingSecrets
|
||||
defaultPodTemplatePath: config/pod-with-secret-volume.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-with-secret-volume.yaml
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-with-secret-volume.yaml
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
- name: 500Nodes
|
||||
@ -169,6 +166,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingPodAffinity
|
||||
defaultPodTemplatePath: config/pod-with-pod-affinity.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -181,11 +179,9 @@
|
||||
count: 2
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-with-pod-affinity.yaml
|
||||
namespace: sched-0
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-with-pod-affinity.yaml
|
||||
namespace: sched-1
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
@ -201,6 +197,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingPreferredPodAffinity
|
||||
defaultPodTemplatePath: config/pod-with-preferred-pod-affinity.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -211,11 +208,9 @@
|
||||
count: 2
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-with-preferred-pod-affinity.yaml
|
||||
namespace: sched-0
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-with-preferred-pod-affinity.yaml
|
||||
namespace: sched-1
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
@ -231,6 +226,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingPreferredPodAntiAffinity
|
||||
defaultPodTemplatePath: config/pod-with-preferred-pod-affinity.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -241,11 +237,9 @@
|
||||
count: 2
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-with-preferred-pod-anti-affinity.yaml
|
||||
namespace: sched-0
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-with-preferred-pod-anti-affinity.yaml
|
||||
namespace: sched-1
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
@ -261,6 +255,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingNodeAffinity
|
||||
defaultPodTemplatePath: config/pod-with-node-affinity.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -270,10 +265,8 @@
|
||||
labelValues: ["zone1"]
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-with-node-affinity.yaml
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-with-node-affinity.yaml
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
- name: 500Nodes
|
||||
@ -342,6 +335,7 @@
|
||||
measurePods: 2000
|
||||
|
||||
- name: MixedSchedulingBasePod
|
||||
defaultPodTemplatePath: config/pod-default.yaml
|
||||
workloadTemplate:
|
||||
- opcode: createNodes
|
||||
countParam: $initNodes
|
||||
@ -354,7 +348,6 @@
|
||||
count: 1
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
podTemplatePath: config/pod-default.yaml
|
||||
namespace: sched-0
|
||||
- opcode: createPods
|
||||
countParam: $initPods
|
||||
@ -374,7 +367,6 @@
|
||||
namespace: sched-0
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-default.yaml
|
||||
collectMetrics: true
|
||||
workloads:
|
||||
- name: 500Nodes
|
||||
@ -498,6 +490,7 @@
|
||||
measurePods: 2000
|
||||
|
||||
- name: SchedulingRequiredPodAntiAffinityWithNSSelector
|
||||
defaultPodTemplatePath: config/pod-anti-affinity-ns-selector.yaml
|
||||
featureGates:
|
||||
PodAffinityNamespaceSelector: true
|
||||
workloadTemplate:
|
||||
@ -519,10 +512,8 @@
|
||||
createPodsOp:
|
||||
opcode: createPods
|
||||
countParam: $initPodsPerNamespace
|
||||
podTemplatePath: config/pod-anti-affinity-ns-selector.yaml
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-anti-affinity-ns-selector.yaml
|
||||
collectMetrics: true
|
||||
namespace: measure-ns-0
|
||||
workloads:
|
||||
@ -534,6 +525,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingPreferredAntiAffinityWithNSSelector
|
||||
defaultPodTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
|
||||
featureGates:
|
||||
PodAffinityNamespaceSelector: true
|
||||
workloadTemplate:
|
||||
@ -555,10 +547,8 @@
|
||||
createPodsOp:
|
||||
opcode: createPods
|
||||
countParam: $initPodsPerNamespace
|
||||
podTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-preferred-anti-affinity-ns-selector.yaml
|
||||
collectMetrics: true
|
||||
namespace: measure-ns-0
|
||||
workloads:
|
||||
@ -570,6 +560,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingRequiredPodAffinityWithNSSelector
|
||||
defaultPodTemplatePath: config/pod-affinity-ns-selector.yaml
|
||||
featureGates:
|
||||
PodAffinityNamespaceSelector: true
|
||||
workloadTemplate:
|
||||
@ -592,10 +583,8 @@
|
||||
createPodsOp:
|
||||
opcode: createPods
|
||||
countParam: $initPodsPerNamespace
|
||||
podTemplatePath: config/pod-affinity-ns-selector.yaml
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-affinity-ns-selector.yaml
|
||||
collectMetrics: true
|
||||
namespace: measure-ns-0
|
||||
workloads:
|
||||
@ -607,6 +596,7 @@
|
||||
measurePods: 1000
|
||||
|
||||
- name: SchedulingPreferredAffinityWithNSSelector
|
||||
defaultPodTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
|
||||
featureGates:
|
||||
PodAffinityNamespaceSelector: true
|
||||
workloadTemplate:
|
||||
@ -628,10 +618,8 @@
|
||||
createPodsOp:
|
||||
opcode: createPods
|
||||
countParam: $initPodsPerNamespace
|
||||
podTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
|
||||
- opcode: createPods
|
||||
countParam: $measurePods
|
||||
podTemplatePath: config/pod-preferred-affinity-ns-selector.yaml
|
||||
collectMetrics: true
|
||||
namespace: measure-ns-0
|
||||
workloads:
|
||||
|
@ -103,9 +103,9 @@ type testCase struct {
|
||||
Workloads []*workload
|
||||
// SchedulerConfigFile is the path of scheduler configuration
|
||||
SchedulerConfigFile string
|
||||
// TODO(#93792): reduce config toil by having a default pod and node spec per
|
||||
// testCase? CreatePods and CreateNodes ops will inherit these unless
|
||||
// manually overridden.
|
||||
// Default path to spec file describing the pods to create. Optional.
|
||||
// This path can be overridden in createPodsOp by setting PodTemplatePath .
|
||||
DefaultPodTemplatePath *string
|
||||
}
|
||||
|
||||
func (tc *testCase) collectsMetrics() bool {
|
||||
@ -353,6 +353,7 @@ type createPodsOp struct {
|
||||
// namespace of the format "namespace-<number>".
|
||||
Namespace *string
|
||||
// Path to spec file describing the pods to schedule. Optional.
|
||||
// If nil, DefaultPodTemplatePath will be used.
|
||||
PodTemplatePath *string
|
||||
// Whether or not to wait for all pods in this op to get scheduled. Optional,
|
||||
// defaults to false.
|
||||
@ -708,6 +709,9 @@ func runWorkload(b *testing.B, tc *testCase, w *workload) []DataItem {
|
||||
}
|
||||
numPodsScheduledPerNamespace[namespace] = 0
|
||||
}
|
||||
if concreteOp.PodTemplatePath == nil {
|
||||
concreteOp.PodTemplatePath = tc.DefaultPodTemplatePath
|
||||
}
|
||||
var collectors []testDataCollector
|
||||
var collectorCtx context.Context
|
||||
var collectorCancel func()
|
||||
|
Loading…
Reference in New Issue
Block a user