From 217b46586ef300591c312effcef6161087a8be36 Mon Sep 17 00:00:00 2001 From: tiberiugc Date: Thu, 13 Jun 2024 17:37:06 +0300 Subject: [PATCH 1/2] Schedule pods on a nodegroup on which no concurrent actions are executed --- 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 | 13 +++++++++++++ 5 files changed, 21 insertions(+) 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..a1693a00cc 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, @@ -1196,6 +1208,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), From 9cccd1daa27a8e7e597a7c325b0e0803138efee2 Mon Sep 17 00:00:00 2001 From: tiberiugc Date: Fri, 14 Jun 2024 09:25:48 +0300 Subject: [PATCH 2/2] patch test assertions --- integration/tests/crud/creategetdelete_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration/tests/crud/creategetdelete_test.go b/integration/tests/crud/creategetdelete_test.go index a1693a00cc..10596a9567 100644 --- a/integration/tests/crud/creategetdelete_test.go +++ b/integration/tests/crud/creategetdelete_test.go @@ -226,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 @@ -239,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),