From 09a0f1d0d17c81f8dd0faad36a3291e57a30cf89 Mon Sep 17 00:00:00 2001 From: Marwan Ahmed Date: Thu, 2 Jan 2025 22:45:53 -0500 Subject: [PATCH] fix: schedule initial workload and filter on worker nodes --- .../init-workload.yaml | 13 +++++++++++++ test/e2e/plugin-config-scoring-strategy/test.sh | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 test/e2e/plugin-config-scoring-strategy/init-workload.yaml diff --git a/test/e2e/plugin-config-scoring-strategy/init-workload.yaml b/test/e2e/plugin-config-scoring-strategy/init-workload.yaml new file mode 100644 index 00000000..144c20d7 --- /dev/null +++ b/test/e2e/plugin-config-scoring-strategy/init-workload.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: init-workload + annotations: + multicluster.admiralty.io/elect: "" +spec: + containers: + - name: pause + image: gcr.io/google_containers/pause + resources: + requests: + cpu: 1 \ No newline at end of file diff --git a/test/e2e/plugin-config-scoring-strategy/test.sh b/test/e2e/plugin-config-scoring-strategy/test.sh index 27b3a3e4..ab072bbf 100644 --- a/test/e2e/plugin-config-scoring-strategy/test.sh +++ b/test/e2e/plugin-config-scoring-strategy/test.sh @@ -24,8 +24,11 @@ plugin-config-scoring-strategy_test() { j=$2 k $j label node --all a=b --overwrite - # Find the node with the highest CPU utilization - nodes=$(k $j get nodes -o name | sed s/"node\/"//) + k $i apply -f test/e2e/plugin-config-scoring-strategy/init-workload.yaml + k $i wait pod init-workload --for=condition=PodScheduled + + # Find the worker node with the highest CPU utilization + nodes=$(k $j get nodes -l '!node-role.kubernetes.io/control-plane' -o name | sed s/"node\/"//) most_allocated="" most_cpu_requests="0" for node in $nodes; do