Skip to content

Commit 56e7036

Browse files
authored
Merge pull request #5540 from afarbos/af/AddAllManagedMachineAMIType
✨ Add all ManagedMachineAMITypes supported by AWS API
2 parents 7d9501c + b3b83d9 commit 56e7036

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,22 @@ spec:
548548
- AL2_x86_64
549549
- AL2_x86_64_GPU
550550
- AL2_ARM_64
551+
- CUSTOM
552+
- BOTTLEROCKET_ARM_64
553+
- BOTTLEROCKET_x86_64
554+
- BOTTLEROCKET_ARM_64_FIPS
555+
- BOTTLEROCKET_x86_64_FIPS
556+
- BOTTLEROCKET_ARM_64_NVIDIA
557+
- BOTTLEROCKET_x86_64_NVIDIA
558+
- WINDOWS_CORE_2019_x86_64
559+
- WINDOWS_FULL_2019_x86_64
560+
- WINDOWS_CORE_2022_x86_64
561+
- WINDOWS_FULL_2022_x86_64
551562
- AL2023_x86_64_STANDARD
552563
- AL2023_ARM_64_STANDARD
553-
- CUSTOM
564+
- AL2023_x86_64_NEURON
565+
- AL2023_x86_64_NVIDIA
566+
- AL2023_ARM_64_NVIDIA
554567
type: string
555568
amiVersion:
556569
description: |-

exp/api/v1beta2/awsmanagedmachinepool_types.go

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
)
2828

2929
// ManagedMachineAMIType specifies which AWS AMI to use for a managed MachinePool.
30+
// Source of truth can be found using the link below:
31+
// https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateNodegroup.html#AmazonEKS-CreateNodegroup-request-amiType
3032
type ManagedMachineAMIType string
3133

3234
const (
@@ -36,10 +38,38 @@ const (
3638
Al2x86_64GPU ManagedMachineAMIType = "AL2_x86_64_GPU"
3739
// Al2Arm64 is the Arm AMI type.
3840
Al2Arm64 ManagedMachineAMIType = "AL2_ARM_64"
41+
// Custom is the custom AMI type.
42+
Custom ManagedMachineAMIType = "CUSTOM"
43+
// BottleRocketArm64 is the Arm AMI type.
44+
BottleRocketArm64 ManagedMachineAMIType = "BOTTLEROCKET_ARM_64"
45+
// BottleRocketx86_64 is the BottleRocket x86-64 AMI type.
46+
BottleRocketx86_64 ManagedMachineAMIType = "BOTTLEROCKET_x86_64"
47+
// BottleRocketArm64Fips is the BottleRocket Arm Fips AMI type.
48+
BottleRocketArm64Fips ManagedMachineAMIType = "BOTTLEROCKET_ARM_64_FIPS"
49+
// BottleRocketx86_64Fips is the BottleRocket x86-64 Fips AMI type.
50+
BottleRocketx86_64Fips ManagedMachineAMIType = "BOTTLEROCKET_x86_64_FIPS"
51+
// BottleRocketArm64Nvidia is the BottleRocket Arm Nvidia AMI type.
52+
BottleRocketArm64Nvidia ManagedMachineAMIType = "BOTTLEROCKET_ARM_64_NVIDIA"
53+
// BottleRocketx86_64Nvidia is the BottleRocket x86-64 Nvidia AMI type.
54+
BottleRocketx86_64Nvidia ManagedMachineAMIType = "BOTTLEROCKET_x86_64_NVIDIA"
55+
// WindowsCore2019x86_64 is the Windows Core 2019 x86-64 AMI type.
56+
WindowsCore2019x86_64 ManagedMachineAMIType = "WINDOWS_CORE_2019_x86_64"
57+
// WindowsFull2019x86_64 is the Windows Full 2019 x86-64 AMI type.
58+
WindowsFull2019x86_64 ManagedMachineAMIType = "WINDOWS_FULL_2019_x86_64"
59+
// WindowsCore2022x86_64 is the Windows Core 2022 x86-64 AMI type.
60+
WindowsCore2022x86_64 ManagedMachineAMIType = "WINDOWS_CORE_2022_x86_64"
61+
// WindowsFull2022x86_64 is the Windows Full 2022 x86-64 AMI type.
62+
WindowsFull2022x86_64 ManagedMachineAMIType = "WINDOWS_FULL_2022_x86_64"
3963
// Al2023x86_64 is the AL2023 x86-64 AMI type.
4064
Al2023x86_64 ManagedMachineAMIType = "AL2023_x86_64_STANDARD"
4165
// Al2023Arm64 is the AL2023 Arm AMI type.
4266
Al2023Arm64 ManagedMachineAMIType = "AL2023_ARM_64_STANDARD"
67+
// Al2023x86_64Neuron is the AL2023 x86-64 Neuron AMI type.
68+
Al2023x86_64Neuron ManagedMachineAMIType = "AL2023_x86_64_NEURON"
69+
// Al2023x86_64Nvidia is the AL2023 x86-64 Nvidia AMI type.
70+
Al2023x86_64Nvidia ManagedMachineAMIType = "AL2023_x86_64_NVIDIA"
71+
// Al2023Arm64Nvidia is the AL2023 Arm Nvidia AMI type.
72+
Al2023Arm64Nvidia ManagedMachineAMIType = "AL2023_ARM_64_NVIDIA"
4373
)
4474

4575
// ManagedMachinePoolCapacityType specifies the capacity type to be used for the managed MachinePool.
@@ -129,7 +159,7 @@ type AWSManagedMachinePoolSpec struct {
129159
AMIVersion *string `json:"amiVersion,omitempty"`
130160

131161
// AMIType defines the AMI type
132-
// +kubebuilder:validation:Enum:=AL2_x86_64;AL2_x86_64_GPU;AL2_ARM_64;AL2023_x86_64_STANDARD;AL2023_ARM_64_STANDARD;CUSTOM
162+
// +kubebuilder:validation:Enum:=AL2_x86_64;AL2_x86_64_GPU;AL2_ARM_64;CUSTOM;BOTTLEROCKET_ARM_64;BOTTLEROCKET_x86_64;BOTTLEROCKET_ARM_64_FIPS;BOTTLEROCKET_x86_64_FIPS;BOTTLEROCKET_ARM_64_NVIDIA;BOTTLEROCKET_x86_64_NVIDIA;WINDOWS_CORE_2019_x86_64;WINDOWS_FULL_2019_x86_64;WINDOWS_CORE_2022_x86_64;WINDOWS_FULL_2022_x86_64;AL2023_x86_64_STANDARD;AL2023_ARM_64_STANDARD;AL2023_x86_64_NEURON;AL2023_x86_64_NVIDIA;AL2023_ARM_64_NVIDIA
133163
// +kubebuilder:default:=AL2_x86_64
134164
// +optional
135165
AMIType *ManagedMachineAMIType `json:"amiType,omitempty"`

pkg/cloud/converters/eks.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,38 @@ func AMITypeToSDK(amiType expinfrav1.ManagedMachineAMIType) ekstypes.AMITypes {
226226
return ekstypes.AMITypesAl2X8664Gpu
227227
case expinfrav1.Al2Arm64:
228228
return ekstypes.AMITypesAl2Arm64
229+
case expinfrav1.Custom:
230+
return ekstypes.AMITypesCustom
231+
case expinfrav1.BottleRocketArm64:
232+
return ekstypes.AMITypesBottlerocketArm64
233+
case expinfrav1.BottleRocketx86_64:
234+
return ekstypes.AMITypesBottlerocketX8664
235+
case expinfrav1.BottleRocketArm64Fips:
236+
return ekstypes.AMITypesBottlerocketArm64Fips
237+
case expinfrav1.BottleRocketx86_64Fips:
238+
return ekstypes.AMITypesBottlerocketX8664Fips
239+
case expinfrav1.BottleRocketArm64Nvidia:
240+
return ekstypes.AMITypesBottlerocketArm64Nvidia
241+
case expinfrav1.BottleRocketx86_64Nvidia:
242+
return ekstypes.AMITypesBottlerocketX8664Nvidia
243+
case expinfrav1.WindowsCore2019x86_64:
244+
return ekstypes.AMITypesWindowsCore2019X8664
245+
case expinfrav1.WindowsFull2019x86_64:
246+
return ekstypes.AMITypesWindowsFull2019X8664
247+
case expinfrav1.WindowsCore2022x86_64:
248+
return ekstypes.AMITypesWindowsCore2022X8664
249+
case expinfrav1.WindowsFull2022x86_64:
250+
return ekstypes.AMITypesWindowsFull2022X8664
229251
case expinfrav1.Al2023Arm64:
230252
return ekstypes.AMITypesAl2023Arm64Standard
231253
case expinfrav1.Al2023x86_64:
232254
return ekstypes.AMITypesAl2023X8664Standard
255+
case expinfrav1.Al2023x86_64Neuron:
256+
return ekstypes.AMITypesAl2023X8664Neuron
257+
case expinfrav1.Al2023x86_64Nvidia:
258+
return ekstypes.AMITypesAl2023X8664Nvidia
259+
case expinfrav1.Al2023Arm64Nvidia:
260+
return ekstypes.AMITypesAl2023Arm64Nvidia
233261
default:
234262
return ekstypes.AMITypesCustom
235263
}

0 commit comments

Comments
 (0)