From ef9e14db79061617236c07bc82382f4465c492c7 Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Wed, 5 Jun 2024 02:35:48 +0000 Subject: [PATCH] scheduler_perf: measure the degradation of daemonset scheduling --- .../config/performance-config.yaml | 27 +++++++++++++++++++ .../config/templates/daemonset-pod.yaml | 17 ++++++++++++ .../config/templates/node-with-name.yaml | 14 ++++++++++ 3 files changed, 58 insertions(+) create mode 100644 test/integration/scheduler_perf/config/templates/daemonset-pod.yaml create mode 100644 test/integration/scheduler_perf/config/templates/node-with-name.yaml diff --git a/test/integration/scheduler_perf/config/performance-config.yaml b/test/integration/scheduler_perf/config/performance-config.yaml index 657cd75337d..1b59952f638 100644 --- a/test/integration/scheduler_perf/config/performance-config.yaml +++ b/test/integration/scheduler_perf/config/performance-config.yaml @@ -277,6 +277,33 @@ initPods: 5000 measurePods: 1000 +# This test case simulates the scheduling of daemonset. +# https://github.com/kubernetes/kubernetes/issues/124709 +- name: SchedulingDaemonset + defaultPodTemplatePath: config/templates/daemonset-pod.yaml + workloadTemplate: + # Create one node with a specific name (scheduler-perf-node), + # which is supposed to get all Pods created in this test case. + - opcode: createNodes + count: 1 + nodeTemplatePath: config/templates/node-with-name.yaml + # Create other nodes that the scheduler has to filter out with PreFilterResult from NodeAffinity plugin. + - opcode: createNodes + countParam: $initNodes + nodeTemplatePath: config/templates/node-default.yaml + # Create pods with nodeAffinity (metadata.name=scheduler-perf-node). + # This scenario doesn't schedule each Pod to each Node though, + # they go through completely the same scheduling process as daemonset pods does. + - opcode: createPods + countParam: $measurePods + collectMetrics: true + workloads: + - name: 15000Nodes + labels: [performance, fast] + params: + initNodes: 15000 + measurePods: 30000 + - name: SchedulingNodeAffinity defaultPodTemplatePath: config/templates/pod-with-node-affinity.yaml workloadTemplate: diff --git a/test/integration/scheduler_perf/config/templates/daemonset-pod.yaml b/test/integration/scheduler_perf/config/templates/daemonset-pod.yaml new file mode 100644 index 00000000000..80e1031438a --- /dev/null +++ b/test/integration/scheduler_perf/config/templates/daemonset-pod.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Pod +metadata: + generateName: daemonset- +spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchFields: + - key: metadata.name + operator: In + values: + - scheduler-perf-node + containers: + - image: registry.k8s.io/pause:3.10 + name: pause \ No newline at end of file diff --git a/test/integration/scheduler_perf/config/templates/node-with-name.yaml b/test/integration/scheduler_perf/config/templates/node-with-name.yaml new file mode 100644 index 00000000000..f273e292665 --- /dev/null +++ b/test/integration/scheduler_perf/config/templates/node-with-name.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Node +metadata: + name: scheduler-perf-node +spec: {} +status: + capacity: + pods: "90000" + cpu: "4" + memory: 32Gi + conditions: + - status: "True" + type: Ready + phase: Running