Skip to content

Commit 5f201b7

Browse files
committed
Add support for WS2025 in eksctl
1 parent d965e8e commit 5f201b7

9 files changed

Lines changed: 107 additions & 7 deletions

File tree

pkg/ami/auto_resolver.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
7171
api.NodeImageFamilyWindowsServer2022FullContainer: {
7272
ImageClassGeneral: fmt.Sprintf("Windows_Server-2022-English-Full-EKS_Optimized-%v-*", version),
7373
},
74+
api.NodeImageFamilyWindowsServer2025CoreContainer: {
75+
ImageClassGeneral: fmt.Sprintf("Windows_Server-2025-English-Core-EKS_Optimized-%v-*", version),
76+
},
77+
api.NodeImageFamilyWindowsServer2025FullContainer: {
78+
ImageClassGeneral: fmt.Sprintf("Windows_Server-2025-English-Full-EKS_Optimized-%v-*", version),
79+
},
7480
}
7581
}
7682

pkg/ami/ssm_resolver.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ func MakeSSMParameterName(version, instanceType, imageFamily string) (string, er
7171
return "", fmt.Errorf("Windows Server 2022 %s requires EKS version %s and above", windowsAmiType(imageFamily), minVersion)
7272
}
7373
return fmt.Sprintf("/aws/service/ami-windows-latest/Windows_Server-2022-English-%s-EKS_Optimized-%s/%s", windowsAmiType(imageFamily), version, fieldName), nil
74+
case api.NodeImageFamilyWindowsServer2025CoreContainer,
75+
api.NodeImageFamilyWindowsServer2025FullContainer:
76+
const minVersion = api.Version1_35
77+
supportsWindows2025, err := utils.IsMinVersion(minVersion, version)
78+
if err != nil {
79+
return "", err
80+
}
81+
if !supportsWindows2025 {
82+
return "", fmt.Errorf("Windows Server 2025 %s requires EKS version %s and above", windowsAmiType(imageFamily), minVersion)
83+
}
84+
return fmt.Sprintf("/aws/service/ami-windows-latest/Windows_Server-2025-English-%s-EKS_Optimized-%s/%s", windowsAmiType(imageFamily), version, fieldName), nil
7485
case api.NodeImageFamilyBottlerocket:
7586
return fmt.Sprintf("/aws/service/bottlerocket/aws-k8s-%s/%s/latest/%s", imageType(imageFamily, instanceType, version), instanceEC2ArchName(instanceType), fieldName), nil
7687
case api.NodeImageFamilyUbuntu2004,

pkg/ami/ssm_resolver_test.go

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,35 @@ var _ = Describe("AMI Auto Resolution", func() {
175175
})
176176
})
177177

178+
Context("Windows Server 2025 Core", func() {
179+
BeforeEach(func() {
180+
version = "1.35"
181+
p = mockprovider.NewMockProvider()
182+
})
183+
184+
It("should return a valid AMI", func() {
185+
imageFamily = "WindowsServer2025CoreContainer"
186+
addMockGetParameter(p, "/aws/service/ami-windows-latest/Windows_Server-2025-English-Core-EKS_Optimized-1.35/image_id", expectedAmi)
187+
188+
resolver := NewSSMResolver(p.MockSSM())
189+
resolvedAmi, err = resolver.Resolve(context.Background(), region, version, instanceType, imageFamily)
190+
191+
Expect(err).NotTo(HaveOccurred())
192+
Expect(resolvedAmi).To(BeEquivalentTo(expectedAmi))
193+
Expect(p.MockSSM().AssertNumberOfCalls(GinkgoT(), "GetParameter", 1)).To(BeTrue())
194+
})
195+
196+
It("should return an error for EKS versions below 1.35", func() {
197+
imageFamily = "WindowsServer2025CoreContainer"
198+
199+
resolver := NewSSMResolver(p.MockSSM())
200+
resolvedAmi, err = resolver.Resolve(context.Background(), region, "1.34", instanceType, imageFamily)
201+
202+
Expect(err).To(HaveOccurred())
203+
Expect(err).To(MatchError(ContainSubstring("Windows Server 2025 Core requires EKS version 1.35 and above")))
204+
})
205+
})
206+
178207
})
179208

180209
Context("and Windows Full family", func() {
@@ -232,6 +261,35 @@ var _ = Describe("AMI Auto Resolution", func() {
232261
})
233262
})
234263

264+
Context("Windows Server 2025 Full", func() {
265+
BeforeEach(func() {
266+
version = "1.35"
267+
p = mockprovider.NewMockProvider()
268+
})
269+
270+
It("should return a valid AMI", func() {
271+
imageFamily = "WindowsServer2025FullContainer"
272+
addMockGetParameter(p, "/aws/service/ami-windows-latest/Windows_Server-2025-English-Full-EKS_Optimized-1.35/image_id", expectedAmi)
273+
274+
resolver := NewSSMResolver(p.MockSSM())
275+
resolvedAmi, err = resolver.Resolve(context.Background(), region, version, instanceType, imageFamily)
276+
277+
Expect(err).NotTo(HaveOccurred())
278+
Expect(resolvedAmi).To(BeEquivalentTo(expectedAmi))
279+
Expect(p.MockSSM().AssertNumberOfCalls(GinkgoT(), "GetParameter", 1)).To(BeTrue())
280+
})
281+
282+
It("should return an error for EKS versions below 1.34", func() {
283+
imageFamily = "WindowsServer2025FullContainer"
284+
285+
resolver := NewSSMResolver(p.MockSSM())
286+
resolvedAmi, err = resolver.Resolve(context.Background(), region, "1.34", instanceType, imageFamily)
287+
288+
Expect(err).To(HaveOccurred())
289+
Expect(err).To(MatchError(ContainSubstring("Windows Server 2025 Full requires EKS version 1.35 and above")))
290+
})
291+
})
292+
235293
})
236294

237295
Context("and Ubuntu2004 family", func() {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ func GetAMIType(amiFamily, instanceType string, strict bool) ekstypes.AMITypes {
5656
X86x64: ekstypes.AMITypesWindowsCore2022X8664,
5757
X86Nvidia: ekstypes.AMITypesWindowsCore2022X8664,
5858
},
59+
NodeImageFamilyWindowsServer2025FullContainer: {
60+
X86x64: ekstypes.AMITypes("WINDOWS_FULL_2025_x86_64"),
61+
X86Nvidia: ekstypes.AMITypes("WINDOWS_FULL_2025_x86_64"),
62+
},
63+
NodeImageFamilyWindowsServer2025CoreContainer: {
64+
X86x64: ekstypes.AMITypes("WINDOWS_CORE_2025_x86_64"),
65+
X86Nvidia: ekstypes.AMITypes("WINDOWS_CORE_2025_x86_64"),
66+
},
5967
}
6068

6169
amiType, ok := amiTypeMapping[amiFamily]

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,8 +1651,8 @@
16511651
},
16521652
"amiFamily": {
16531653
"type": "string",
1654-
"description": "Valid variants are: `\"AmazonLinux2023\"` (default), `\"AmazonLinux2\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
1655-
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2023&quot;</code> (default), <code>&quot;AmazonLinux2&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>.",
1654+
"description": "Valid variants are: `\"AmazonLinux2023\"` (default), `\"AmazonLinux2\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`, `\"WindowsServer2025CoreContainer\"`, `\"WindowsServer2025FullContainer\"`.",
1655+
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2023&quot;</code> (default), <code>&quot;AmazonLinux2&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>, <code>&quot;WindowsServer2025CoreContainer&quot;</code>, <code>&quot;WindowsServer2025FullContainer&quot;</code>.",
16561656
"default": "AmazonLinux2023",
16571657
"enum": [
16581658
"AmazonLinux2023",
@@ -1667,7 +1667,9 @@
16671667
"WindowsServer2019CoreContainer",
16681668
"WindowsServer2019FullContainer",
16691669
"WindowsServer2022CoreContainer",
1670-
"WindowsServer2022FullContainer"
1670+
"WindowsServer2022FullContainer",
1671+
"WindowsServer2025CoreContainer",
1672+
"WindowsServer2025FullContainer"
16711673
]
16721674
},
16731675
"asgSuspendProcesses": {
@@ -2001,8 +2003,8 @@
20012003
},
20022004
"amiFamily": {
20032005
"type": "string",
2004-
"description": "Valid variants are: `\"AmazonLinux2023\"` (default), `\"AmazonLinux2\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
2005-
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2023&quot;</code> (default), <code>&quot;AmazonLinux2&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>.",
2006+
"description": "Valid variants are: `\"AmazonLinux2023\"` (default), `\"AmazonLinux2\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`, `\"WindowsServer2025CoreContainer\"`, `\"WindowsServer2025FullContainer\"`.",
2007+
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2023&quot;</code> (default), <code>&quot;AmazonLinux2&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>, <code>&quot;WindowsServer2025CoreContainer&quot;</code>, <code>&quot;WindowsServer2025FullContainer&quot;</code>.",
20062008
"default": "AmazonLinux2023",
20072009
"enum": [
20082010
"AmazonLinux2023",
@@ -2017,7 +2019,9 @@
20172019
"WindowsServer2019CoreContainer",
20182020
"WindowsServer2019FullContainer",
20192021
"WindowsServer2022CoreContainer",
2020-
"WindowsServer2022FullContainer"
2022+
"WindowsServer2022FullContainer",
2023+
"WindowsServer2025CoreContainer",
2024+
"WindowsServer2025FullContainer"
20212025
]
20222026
},
20232027
"asgMetricsCollection": {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ var _ = Describe("Outposts validation", func() {
217217
Entry("Windows2019Full", api.NodeImageFamilyWindowsServer2019FullContainer, true),
218218
Entry("Windows2022Core", api.NodeImageFamilyWindowsServer2022CoreContainer, true),
219219
Entry("Windows2022Full", api.NodeImageFamilyWindowsServer2022FullContainer, true),
220+
Entry("Windows2025Core", api.NodeImageFamilyWindowsServer2025CoreContainer, true),
221+
Entry("Windows2025Full", api.NodeImageFamilyWindowsServer2025FullContainer, true),
220222
)
221223

222224
type nodeGroupEntry struct {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const (
4848
Version1_31 = "1.31"
4949
Version1_32 = "1.32"
5050
Version1_33 = "1.33"
51+
Version1_34 = "1.34"
52+
Version1_35 = "1.35"
5153
DockershimDeprecationVersion = Version1_24
5254
AmazonLinux2EOLVersion = Version1_33
5355
// EFABuiltInSupportVersion defines the minimum Kubernetes version that supports built-in EFA
@@ -223,6 +225,9 @@ const (
223225

224226
NodeImageFamilyWindowsServer2022CoreContainer = "WindowsServer2022CoreContainer"
225227
NodeImageFamilyWindowsServer2022FullContainer = "WindowsServer2022FullContainer"
228+
229+
NodeImageFamilyWindowsServer2025CoreContainer = "WindowsServer2025CoreContainer"
230+
NodeImageFamilyWindowsServer2025FullContainer = "WindowsServer2025FullContainer"
226231
)
227232

228233
// Deprecated `NodeAMIFamily`
@@ -604,6 +609,8 @@ func SupportedAMIFamilies() []string {
604609
NodeImageFamilyWindowsServer2019FullContainer,
605610
NodeImageFamilyWindowsServer2022CoreContainer,
606611
NodeImageFamilyWindowsServer2022FullContainer,
612+
NodeImageFamilyWindowsServer2025CoreContainer,
613+
NodeImageFamilyWindowsServer2025FullContainer,
607614
}
608615
}
609616

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,9 @@ func IsWindowsImage(imageFamily string) bool {
16741674
case NodeImageFamilyWindowsServer2019CoreContainer,
16751675
NodeImageFamilyWindowsServer2019FullContainer,
16761676
NodeImageFamilyWindowsServer2022CoreContainer,
1677-
NodeImageFamilyWindowsServer2022FullContainer:
1677+
NodeImageFamilyWindowsServer2022FullContainer,
1678+
NodeImageFamilyWindowsServer2025CoreContainer,
1679+
NodeImageFamilyWindowsServer2025FullContainer:
16781680
return true
16791681

16801682
default:

userdocs/src/usage/custom-ami-support.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ The `--node-ami-family` can take following keywords:
6868
| WindowsServer2019CoreContainer | Indicates that the EKS AMI image based on Windows Server 2019 Core Container should be used. |
6969
| WindowsServer2022FullContainer | Indicates that the EKS AMI image based on Windows Server 2022 Full Container should be used. |
7070
| WindowsServer2022CoreContainer | Indicates that the EKS AMI image based on Windows Server 2022 Core Container should be used. |
71+
| WindowsServer2025FullContainer | Indicates that the EKS AMI image based on Windows Server 2025 Full Container should be used. |
72+
| WindowsServer2025CoreContainer | Indicates that the EKS AMI image based on Windows Server 2025 Core Container should be used. |
7173

7274
CLI flag example:
7375
```sh

0 commit comments

Comments
 (0)