Skip to content

Commit

Permalink
Merge pull request #581 from mjura/v2.9-ami2023
Browse files Browse the repository at this point in the history
[v2.9] Change default AMI type to Amazon Linux 2023
  • Loading branch information
alexander-demicev authored Jun 5, 2024
2 parents 1d29618 + ecaf2ff commit d4fa9da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions controller/external.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,13 @@ func BuildUpstreamClusterState(ctx context.Context, name, managedTemplateID stri
ngToAdd.Ec2SshKey = ng.Nodegroup.RemoteAccess.Ec2SshKey
}
}
// TODO: Update AMITypesAl2X8664Gpu to Amazon Linux 2023 when it is available
// Issue https://github.com/rancher/eks-operator/issues/568
if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2X8664Gpu {
ngToAdd.Gpu = aws.Bool(true)
} else if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2X8664 {
} else if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2023X8664Standard {
ngToAdd.Gpu = aws.Bool(false)
} else if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2Arm64 {
} else if ng.Nodegroup.AmiType == ekstypes.AMITypesAl2023Arm64Standard {
ngToAdd.Arm = aws.Bool(true)
}
upstreamSpec.NodeGroups = append(upstreamSpec.NodeGroups, ngToAdd)
Expand Down
4 changes: 2 additions & 2 deletions pkg/eks/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ func CreateNodeGroup(ctx context.Context, opts *CreateNodeGroupOptions) (string,
if opts.NodeGroup.LaunchTemplate != nil {
nodeGroupCreateInput.AmiType = ekstypes.AMITypesCustom
} else if arm := opts.NodeGroup.Arm; aws.ToBool(arm) {
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2Arm64
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2023Arm64Standard
} else if gpu := opts.NodeGroup.Gpu; aws.ToBool(gpu) {
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2X8664Gpu
} else {
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2X8664
nodeGroupCreateInput.AmiType = ekstypes.AMITypesAl2023X8664Standard
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/eks/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ var _ = Describe("CreateNodeGroup", func() {
InstanceTypes: createNodeGroupOpts.NodeGroup.SpotInstanceTypes,
Subnets: createNodeGroupOpts.NodeGroup.Subnets,
NodeRole: aws.String("test"),
AmiType: ekstypes.AMITypesAl2Arm64,
AmiType: ekstypes.AMITypesAl2023Arm64Standard,
}).Return(nil, nil)

launchTemplateVersion, generatedNodeRole, err := CreateNodeGroup(ctx, createNodeGroupOpts)
Expand Down Expand Up @@ -1066,7 +1066,7 @@ var _ = Describe("CreateNodeGroup", func() {
InstanceTypes: createNodeGroupOpts.NodeGroup.SpotInstanceTypes,
Subnets: createNodeGroupOpts.NodeGroup.Subnets,
NodeRole: aws.String("test"),
AmiType: ekstypes.AMITypesAl2X8664,
AmiType: ekstypes.AMITypesAl2023X8664Standard,
}).Return(nil, nil)

launchTemplateVersion, generatedNodeRole, err := CreateNodeGroup(ctx, createNodeGroupOpts)
Expand Down

0 comments on commit d4fa9da

Please sign in to comment.