Skip to content

Commit 26909f6

Browse files
authored
Add support for ARM AMI type in managed node group (#246)
- Add support for ARM AMI type in managed node group creation
1 parent 39044a6 commit 26909f6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

eksconfig/add-on-managed-node-groups.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ type MNG struct {
7878
ReleaseVersionValue float64 `json:"release-version-value" read-only:"true"`
7979

8080
// AMIType is the AMI type for the node group.
81-
// Allowed values are AL2_x86_64 and AL2_x86_64_GPU.
81+
// Allowed values are AL2_x86_64, AL2_x86_64_GPU and AL2_ARM_64.
8282
// ref. https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html
83-
// ref. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html
83+
// ref. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-amitype
8484
AMIType string `json:"ami-type,omitempty"`
8585

8686
// InstanceTypes is the EC2 instance types for the node instances.
@@ -404,6 +404,10 @@ func (cfg *Config) validateAddOnManagedNodeGroups() error {
404404
if cur.RemoteAccessUserName != "ec2-user" {
405405
return fmt.Errorf("AMIType %q but unexpected RemoteAccessUserName %q", cur.AMIType, cur.RemoteAccessUserName)
406406
}
407+
case eks.AMITypesAl2Arm64:
408+
if cur.RemoteAccessUserName != "ec2-user" {
409+
return fmt.Errorf("AMIType %q but unexpected RemoteAccessUserName %q", cur.AMIType, cur.RemoteAccessUserName)
410+
}
407411
default:
408412
return fmt.Errorf("unknown ASGs[%q].AMIType %q", k, cur.AMIType)
409413
}
@@ -417,6 +421,10 @@ func (cfg *Config) validateAddOnManagedNodeGroups() error {
417421
if len(cur.InstanceTypes) == 0 {
418422
cur.InstanceTypes = []string{DefaultNodeInstanceTypeGPU}
419423
}
424+
case eks.AMITypesAl2Arm64:
425+
if len(cur.InstanceTypes) == 0 {
426+
cur.InstanceTypes = []string{DefaultNodeInstanceTypeARMCPU}
427+
}
420428
default:
421429
return fmt.Errorf("unknown AddOnManagedNodeGroups.MNGs[%q].AMIType %q", k, cur.AMIType)
422430
}

eksconfig/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,8 @@ const (
829829

830830
// DefaultNodeInstanceTypeCPU is the default EC2 instance type for CPU worker node.
831831
DefaultNodeInstanceTypeCPU = "c5.xlarge"
832+
// DefaultNodeInstanceTypeARMCPU is the default EC2 instance type for ARM CPU worker node.
833+
DefaultNodeInstanceTypeARMCPU = "c6g.xlarge"
832834
// DefaultNodeInstanceTypeGPU is the default EC2 instance type for GPU worker node.
833835
DefaultNodeInstanceTypeGPU = "p3.8xlarge"
834836

0 commit comments

Comments
 (0)