From 4b62d1a3fab80e4c1dfe761e4b7b786b4c976290 Mon Sep 17 00:00:00 2001 From: Tibi <110664232+TiberiuGC@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:23:00 +0300 Subject: [PATCH] Schedule pods on a nodegroup on which no concurrent actions are executed (#7834) * Schedule pods on a nodegroup on which no concurrent actions are executed * patch test assertions --- integration/data/iamserviceaccount-checker.yaml | 2 ++ integration/data/podinfo.yaml | 2 ++ integration/data/test-dns.yaml | 2 ++ integration/data/test-http.yaml | 2 ++ integration/tests/crud/creategetdelete_test.go | 16 +++++++++++++++- 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/integration/data/iamserviceaccount-checker.yaml b/integration/data/iamserviceaccount-checker.yaml index ee79ee7505..5f9226d695 100644 --- a/integration/data/iamserviceaccount-checker.yaml +++ b/integration/data/iamserviceaccount-checker.yaml @@ -18,6 +18,8 @@ spec: serviceAccountName: s3-reader # use a shared volume volumes: [{name: aws-credentials, emptyDir: {}}] + nodeSelector: + used-for: test-pods initContainers: - name: assume-role image: atlassian/pipelines-awscli:1.16.185 diff --git a/integration/data/podinfo.yaml b/integration/data/podinfo.yaml index 7825eaf18d..8cbbbea980 100644 --- a/integration/data/podinfo.yaml +++ b/integration/data/podinfo.yaml @@ -17,6 +17,8 @@ spec: annotations: prometheus.io/scrape: 'true' spec: + nodeSelector: + used-for: test-pods containers: - name: podinfod image: stefanprodan/podinfo:1.5.1@sha256:702633d438950f3675d0763a4ca6cfcf21a4d065cd7f470446c67607b1a26750 diff --git a/integration/data/test-dns.yaml b/integration/data/test-dns.yaml index 2178f8e287..abfbb7bf45 100644 --- a/integration/data/test-dns.yaml +++ b/integration/data/test-dns.yaml @@ -10,6 +10,8 @@ spec: metadata: labels: {test: dns} spec: + nodeSelector: + used-for: test-pods containers: - image: tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe name: dns-test-cluster diff --git a/integration/data/test-http.yaml b/integration/data/test-http.yaml index 1a2eaf944f..030d938c5b 100644 --- a/integration/data/test-http.yaml +++ b/integration/data/test-http.yaml @@ -10,6 +10,8 @@ spec: metadata: labels: {test: http} spec: + nodeSelector: + used-for: test-pods containers: - image: curlimages/curl@sha256:fa32ef426092b88ee0b569d6f81ab0203ee527692a94ec2e6ceb2fd0b6b2755c name: https-test-eksctl diff --git a/integration/tests/crud/creategetdelete_test.go b/integration/tests/crud/creategetdelete_test.go index 040f4adde2..10596a9567 100644 --- a/integration/tests/crud/creategetdelete_test.go +++ b/integration/tests/crud/creategetdelete_test.go @@ -66,6 +66,7 @@ func TestCRUD(t *testing.T) { } const ( + deployNg = "ng-deploy" deleteNg = "ng-delete" taintsNg1 = "ng-taints-1" taintsNg2 = "ng-taints-2" @@ -131,6 +132,17 @@ var _ = SynchronizedBeforeSuite(func() []byte { }, } cfg.ManagedNodeGroups = []*api.ManagedNodeGroup{ + { + NodeGroupBase: &api.NodeGroupBase{ + Name: deployNg, + ScalingConfig: &api.ScalingConfig{ + DesiredCapacity: aws.Int(5), + }, + Labels: map[string]string{ + "used-for": "test-pods", + }, + }, + }, { NodeGroupBase: &api.NodeGroupBase{ Name: drainMng, @@ -214,7 +226,7 @@ var _ = Describe("(Integration) Create, Get, Scale & Delete", func() { Expect(session.ExitCode()).To(BeZero()) var stacks []*cfntypes.Stack Expect(yaml.Unmarshal(session.Out.Contents(), &stacks)).To(Succeed()) - Expect(stacks).To(HaveLen(6)) + Expect(stacks).To(HaveLen(7)) var ( names, descriptions []string @@ -227,6 +239,7 @@ var _ = Describe("(Integration) Create, Get, Scale & Delete", func() { Expect(names).To(ContainElements( ContainSubstring(params.ClusterName+"-cluster"), + ContainSubstring(ngPrefix+deployNg), ContainSubstring(ngPrefix+deleteNg), ContainSubstring(ngPrefix+scaleSingleNg), ContainSubstring(ngPrefix+scaleMultipleNg), @@ -1196,6 +1209,7 @@ var _ = Describe("(Integration) Create, Get, Scale & Delete", func() { "-o", "json", "--cluster", params.ClusterName, )).To(RunSuccessfullyWithOutputString(BeNodeGroupsWithNamesWhich( + ContainElement(deployNg), ContainElement(taintsNg1), ContainElement(taintsNg2), ContainElement(scaleSingleNg),