Skip to content

Commit 236d411

Browse files
authored
Drop support for Ubuntu 18.04 images (#8344)
1 parent 19aaece commit 236d411

File tree

13 files changed

+9
-97
lines changed

13 files changed

+9
-97
lines changed

pkg/ami/auto_resolver.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
5959
ImageClassGeneral: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*20.04-amd64*", version),
6060
ImageClassARM: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*20.04-arm64*", version),
6161
},
62-
api.NodeImageFamilyUbuntu1804: {
63-
ImageClassGeneral: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*18.04*", version),
64-
},
6562
api.NodeImageFamilyWindowsServer2019CoreContainer: {
6663
ImageClassGeneral: fmt.Sprintf("Windows_Server-2019-English-Core-EKS_Optimized-%v-*", version),
6764
},
@@ -80,7 +77,7 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
8077
// OwnerAccountID returns the AWS account ID that owns worker AMI.
8178
func OwnerAccountID(imageFamily, region string) (string, error) {
8279
switch imageFamily {
83-
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004, api.NodeImageFamilyUbuntu1804:
80+
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004:
8481
return ownerIDUbuntuFamily, nil
8582
case api.NodeImageFamilyAmazonLinux2023, api.NodeImageFamilyAmazonLinux2:
8683
return api.EKSResourceAccountID(region), nil

pkg/ami/auto_resolver_test.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,6 @@ var _ = Describe("AMI Auto Resolution", func() {
5050
Expect(ownerAccount).To(BeEquivalentTo("800184023465"))
5151
Expect(err).NotTo(HaveOccurred())
5252
})
53-
54-
It("should return the AWS Account ID for Ubuntu images in ap-east-1", func() {
55-
ownerAccount, err := OwnerAccountID(api.NodeImageFamilyUbuntu1804, "ap-east-1")
56-
Expect(ownerAccount).To(BeEquivalentTo("099720109477"))
57-
Expect(err).NotTo(HaveOccurred())
58-
})
59-
60-
It("should return the Ubuntu Account ID for Ubuntu images", func() {
61-
ownerAccount, err := OwnerAccountID(api.NodeImageFamilyUbuntu1804, region)
62-
Expect(ownerAccount).To(BeEquivalentTo("099720109477"))
63-
Expect(err).NotTo(HaveOccurred())
64-
})
6553
It("should return the Ubuntu Account ID for Ubuntu images", func() {
6654
ownerAccount, err := OwnerAccountID(api.NodeImageFamilyUbuntuPro2004, region)
6755
Expect(ownerAccount).To(BeEquivalentTo("099720109477"))
@@ -132,31 +120,6 @@ var _ = Describe("AMI Auto Resolution", func() {
132120
})
133121
})
134122

135-
Context("and ami is available", func() {
136-
BeforeEach(func() {
137-
imageState = ec2types.ImageStateAvailable
138-
imageFamily = "Ubuntu1804"
139-
140-
p = mockprovider.NewMockProvider()
141-
addMockDescribeImages(p, "ubuntu-eks/k8s_1.15/images/*18.04*", expectedAmi, imageState, "2018-08-20T23:25:53.000Z", api.NodeImageFamilyUbuntu1804)
142-
143-
resolver := NewAutoResolver(p.MockEC2())
144-
resolvedAmi, err = resolver.Resolve(context.Background(), region, version, instanceType, imageFamily)
145-
})
146-
147-
It("should not error", func() {
148-
Expect(err).NotTo(HaveOccurred())
149-
})
150-
151-
It("should have called AWS EC2 DescribeImages", func() {
152-
Expect(p.MockEC2().AssertNumberOfCalls(GinkgoT(), "DescribeImages", 1)).To(BeTrue())
153-
})
154-
155-
It("should have returned an ami id", func() {
156-
Expect(resolvedAmi).To(BeEquivalentTo(expectedAmi))
157-
})
158-
})
159-
160123
Context("and ami is NOT available", func() {
161124
BeforeEach(func() {
162125
imageState = ec2types.ImageStatePending

pkg/ami/ssm_resolver.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ func MakeSSMParameterName(version, instanceType, imageFamily string) (string, er
7373
return fmt.Sprintf("/aws/service/ami-windows-latest/Windows_Server-2022-English-%s-EKS_Optimized-%s/%s", windowsAmiType(imageFamily), version, fieldName), nil
7474
case api.NodeImageFamilyBottlerocket:
7575
return fmt.Sprintf("/aws/service/bottlerocket/aws-k8s-%s/%s/latest/%s", imageType(imageFamily, instanceType, version), instanceEC2ArchName(instanceType), fieldName), nil
76-
case api.NodeImageFamilyUbuntu1804:
77-
return "", &UnsupportedQueryError{msg: fmt.Sprintf("SSM Parameter lookups for %s AMIs is not supported", imageFamily)}
7876
case api.NodeImageFamilyUbuntu2004,
7977
api.NodeImageFamilyUbuntuPro2004,
8078
api.NodeImageFamilyUbuntu2204,

pkg/ami/ssm_resolver_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -234,23 +234,6 @@ var _ = Describe("AMI Auto Resolution", func() {
234234

235235
})
236236

237-
Context("and Ubuntu1804 family", func() {
238-
BeforeEach(func() {
239-
p = mockprovider.NewMockProvider()
240-
instanceType = "t2.medium"
241-
imageFamily = "Ubuntu1804"
242-
})
243-
244-
It("should return an error", func() {
245-
resolver := NewSSMResolver(p.MockSSM())
246-
resolvedAmi, err = resolver.Resolve(context.Background(), region, version, instanceType, imageFamily)
247-
248-
Expect(err).To(HaveOccurred())
249-
Expect(err).To(MatchError("SSM Parameter lookups for Ubuntu1804 AMIs is not supported"))
250-
})
251-
252-
})
253-
254237
Context("and Ubuntu2004 family", func() {
255238
BeforeEach(func() {
256239
p = mockprovider.NewMockProvider()

pkg/apis/eksctl.io/v1alpha5/assets/schema.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,8 @@
13861386
},
13871387
"amiFamily": {
13881388
"type": "string",
1389-
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Ubuntu1804\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
1390-
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Ubuntu2004&quot;</code>, <code>&quot;Ubuntu1804&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
1389+
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
1390+
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Ubuntu2004&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
13911391
"default": "AmazonLinux2",
13921392
"enum": [
13931393
"AmazonLinux2",
@@ -1398,7 +1398,6 @@
13981398
"Ubuntu2204",
13991399
"UbuntuPro2004",
14001400
"Ubuntu2004",
1401-
"Ubuntu1804",
14021401
"Bottlerocket",
14031402
"WindowsServer2019CoreContainer",
14041403
"WindowsServer2019FullContainer",
@@ -1737,8 +1736,8 @@
17371736
},
17381737
"amiFamily": {
17391738
"type": "string",
1740-
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Ubuntu1804\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
1741-
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Ubuntu2004&quot;</code>, <code>&quot;Ubuntu1804&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
1739+
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
1740+
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Ubuntu2004&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
17421741
"default": "AmazonLinux2",
17431742
"enum": [
17441743
"AmazonLinux2",
@@ -1749,7 +1748,6 @@
17491748
"Ubuntu2204",
17501749
"UbuntuPro2004",
17511750
"Ubuntu2004",
1752-
"Ubuntu1804",
17531751
"Bottlerocket",
17541752
"WindowsServer2019CoreContainer",
17551753
"WindowsServer2019FullContainer",

pkg/apis/eksctl.io/v1alpha5/gpu_validation_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ var _ = Describe("GPU instance support", func() {
6363
gpuInstanceType: "g5.12xlarge",
6464
amiFamily: api.NodeImageFamilyAmazonLinux2,
6565
}),
66-
Entry("Ubuntu1804", gpuInstanceEntry{
67-
amiFamily: api.NodeImageFamilyUbuntu2004,
68-
gpuInstanceType: "g4dn.xlarge",
69-
}),
7066
Entry("Ubuntu2004", gpuInstanceEntry{
7167
amiFamily: api.NodeImageFamilyUbuntu2004,
7268
gpuInstanceType: "g4dn.xlarge",
@@ -234,11 +230,6 @@ var _ = Describe("GPU instance support", func() {
234230
},
235231
expectWarning: true,
236232
}),
237-
Entry("Ubuntu with explicit GPU instance", gpuInstanceEntry{
238-
amiFamily: api.NodeImageFamilyUbuntu1804,
239-
gpuInstanceType: "g4dn.xlarge",
240-
expectWarning: true,
241-
}),
242233
Entry("Ubuntu with implicit GPU instance", gpuInstanceEntry{
243234
amiFamily: api.NodeImageFamilyUbuntu2004,
244235
instanceSelector: &api.InstanceSelector{
@@ -280,7 +271,6 @@ var _ = Describe("GPU instance support", func() {
280271
Entry("AmazonLinux2", api.NodeImageFamilyAmazonLinux2, true),
281272
Entry("AmazonLinux2023", api.NodeImageFamilyAmazonLinux2023, true),
282273
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, true),
283-
Entry("Ubuntu1804", api.NodeImageFamilyUbuntu1804, true),
284274
Entry("Windows2019Full", api.NodeImageFamilyWindowsServer2019FullContainer, true),
285275
Entry("Windows2019Core", api.NodeImageFamilyWindowsServer2019CoreContainer, true),
286276
Entry("Bottlerocket", api.NodeImageFamilyBottlerocket, false),

pkg/apis/eksctl.io/v1alpha5/outposts_validation_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ var _ = Describe("Outposts validation", func() {
206206
},
207207
Entry("AmazonLinux2", api.NodeImageFamilyAmazonLinux2, false),
208208
Entry("Bottlerocket", api.NodeImageFamilyBottlerocket, true),
209-
Entry("Ubuntu1804", api.NodeImageFamilyUbuntu1804, true),
210209
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, true),
211210
Entry("UbuntuPro2004", api.NodeImageFamilyUbuntuPro2004, true),
212211
Entry("Ubuntu2204", api.NodeImageFamilyUbuntu2204, true),

pkg/apis/eksctl.io/v1alpha5/types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ const (
203203
NodeImageFamilyUbuntu2204 = "Ubuntu2204"
204204
NodeImageFamilyUbuntuPro2004 = "UbuntuPro2004"
205205
NodeImageFamilyUbuntu2004 = "Ubuntu2004"
206-
NodeImageFamilyUbuntu1804 = "Ubuntu1804"
207206
NodeImageFamilyBottlerocket = "Bottlerocket"
208207

209208
NodeImageFamilyWindowsServer2019CoreContainer = "WindowsServer2019CoreContainer"
@@ -559,7 +558,6 @@ func SupportedAMIFamilies() []string {
559558
NodeImageFamilyUbuntu2204,
560559
NodeImageFamilyUbuntuPro2004,
561560
NodeImageFamilyUbuntu2004,
562-
NodeImageFamilyUbuntu1804,
563561
NodeImageFamilyBottlerocket,
564562
NodeImageFamilyWindowsServer2019CoreContainer,
565563
NodeImageFamilyWindowsServer2019FullContainer,

pkg/apis/eksctl.io/v1alpha5/validation.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,8 +1627,7 @@ func IsUbuntuImage(imageFamily string) bool {
16271627
NodeImageFamilyUbuntuPro2204,
16281628
NodeImageFamilyUbuntu2204,
16291629
NodeImageFamilyUbuntuPro2004,
1630-
NodeImageFamilyUbuntu2004,
1631-
NodeImageFamilyUbuntu1804:
1630+
NodeImageFamilyUbuntu2004:
16321631
return true
16331632

16341633
default:

pkg/apis/eksctl.io/v1alpha5/validation_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,10 +2254,6 @@ var _ = Describe("ClusterConfig validation", func() {
22542254
err := api.ValidateManagedNodeGroup(0, mng)
22552255
Expect(err).NotTo(HaveOccurred())
22562256

2257-
mng.AMIFamily = api.NodeImageFamilyUbuntu1804
2258-
err = api.ValidateManagedNodeGroup(0, mng)
2259-
Expect(err).NotTo(HaveOccurred())
2260-
22612257
mng.AMIFamily = api.NodeImageFamilyUbuntu2004
22622258
err = api.ValidateManagedNodeGroup(0, mng)
22632259
Expect(err).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)