Skip to content

Commit

Permalink
test: Add nodegroup with Ubuntu Pro 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
aciba90 committed Apr 22, 2024
1 parent 2a1dd93 commit ff49291
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
31 changes: 31 additions & 0 deletions integration/tests/custom_ami/custom_ami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var (
customAMIAL2 string
customAMIAL2023 string
customAMIBottlerocket string
customAMIUbuntuPro2204 string
)

var _ = BeforeSuite(func() {
Expand Down Expand Up @@ -70,6 +71,14 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
customAMIBottlerocket = *output.Parameter.Value

// retrieve Ubuntu Pro 22.04 AMI
input = &awsssm.GetParameterInput{
Name: aws.String(fmt.Sprintf("/aws/service/canonical/ubuntu/eks-pro/22.04/%s/stable/current/amd64/hvm/ebs-gp2/ami-id" , params.Version)),
}
output, err = ssm.GetParameter(context.Background(), input)
Expect(err).NotTo(HaveOccurred())
customAMIUbuntuPro2204 = *output.Parameter.Value

cmd := params.EksctlCreateCmd.WithArgs(
"cluster",
"--verbose", "4",
Expand Down Expand Up @@ -147,6 +156,28 @@ var _ = Describe("(Integration) [Test Custom AMI]", func() {
})

})

Context("ubuntu-pro-2204 un-managed nodegroups", func() {

It("can create a working nodegroup which can join the cluster", func() {
By(fmt.Sprintf("using the following EKS optimised AMI: %s", customAMIUbuntuPro2204))
content, err := os.ReadFile(filepath.Join("testdata/ubuntu-pro-2204.yaml"))
Expect(err).NotTo(HaveOccurred())
content = bytes.ReplaceAll(content, []byte("<generated>"), []byte(params.ClusterName))
content = bytes.ReplaceAll(content, []byte("<generated-region>"), []byte(params.Region))
content = bytes.ReplaceAll(content, []byte("<generated-ami>"), []byte(customAMIBottlerocket))
cmd := params.EksctlCreateCmd.
WithArgs(
"nodegroup",
"--config-file", "-",
"--verbose", "4",
).
WithoutArg("--region", params.Region).
WithStdin(bytes.NewReader(content))
Expect(cmd).To(RunSuccessfully())
})

})
})

var _ = AfterSuite(func() {
Expand Down
13 changes: 13 additions & 0 deletions integration/tests/custom_ami/testdata/ubuntu-pro-2204.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

# name is generated
metadata:
name: <generated>
region: <generated-region>

nodeGroups:
- name: unm-ubuntu-pro-2204
ami: <generated-ami>
amiFamily: UbuntuPro2204
desiredCapacity: 1

0 comments on commit ff49291

Please sign in to comment.