Skip to content

Commit 3c37507

Browse files
author
Nathan Clonts
committed
Merge branch 'main' into bug-serviceaccounts-list-error
2 parents f6f5694 + a710a1b commit 3c37507

File tree

16 files changed

+163
-113
lines changed

16 files changed

+163
-113
lines changed

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ require (
1313
github.com/aws/aws-sdk-go-v2/credentials v1.17.65
1414
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3
1515
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2
16-
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.4
16+
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.3
1717
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.3
1818
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.51.3
1919
github.com/aws/aws-sdk-go-v2/service/ec2 v1.210.1
20-
github.com/aws/aws-sdk-go-v2/service/eks v1.63.2
21-
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.3
22-
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.2
20+
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0
21+
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.2
22+
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.1
2323
github.com/aws/aws-sdk-go-v2/service/iam v1.41.1
2424
github.com/aws/aws-sdk-go-v2/service/kms v1.38.1
2525
github.com/aws/aws-sdk-go-v2/service/outposts v1.50.1
@@ -74,7 +74,7 @@ require (
7474
golang.org/x/sync v0.12.0
7575
golang.org/x/text v0.23.0
7676
gopkg.in/yaml.v2 v2.4.0
77-
helm.sh/helm/v3 v3.17.2
77+
helm.sh/helm/v3 v3.17.3
7878
k8s.io/api v0.32.3
7979
k8s.io/apiextensions-apiserver v0.32.3
8080
k8s.io/apimachinery v0.32.3
@@ -411,7 +411,7 @@ require (
411411
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
412412
golang.org/x/exp/typeparams v0.0.0-20250305212735-054e65f0b394 // indirect
413413
golang.org/x/mod v0.24.0 // indirect
414-
golang.org/x/net v0.37.0 // indirect
414+
golang.org/x/net v0.38.0 // indirect
415415
golang.org/x/sys v0.31.0 // indirect
416416
golang.org/x/term v0.30.0 // indirect
417417
golang.org/x/time v0.10.0 // indirect

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,20 @@ github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3 h1:QsKdBxtC8csnKt5BbV7D
128128
github.com/aws/aws-sdk-go-v2/service/autoscaling v1.52.3/go.mod h1:CDqMoc3KRdZJ8qziW96J35lKH01Wq3B2aihtHj2JbRs=
129129
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2 h1:o9cuZdZlI9VWMqsNa2mnf2IRsFAROHnaYA1BW3lHGuY=
130130
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.59.2/go.mod h1:penaZKzGmqHGZId4EUCBIW/f9l4Y7hQ5NKd45yoCYuI=
131-
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.4 h1:pQpinmWv9jEisDR6/DccOf2cXdAf/CAwQ39nfJfJDlE=
132-
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.4/go.mod h1:/BibEr5ksr34abqBTQN213GrNG6GCKCB6WG7CH4zH2w=
131+
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.3 h1:nTKHvvDTsS6SqAqu/fDhpmbNmDz+0ONh8niPoCkhPtM=
132+
github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.48.3/go.mod h1:/BibEr5ksr34abqBTQN213GrNG6GCKCB6WG7CH4zH2w=
133133
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.3 h1:3y0jkGtsaZLCg+n73BoSXOAkLFtgmD/+4prXW1pzovc=
134134
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.47.3/go.mod h1:uo14VBn5cNk/BPGTPz3kyLBxgpgOObgO8lmz+H7Z4Ck=
135135
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.51.3 h1:4U9dpQZTvJ0Mi1qn8L1hRJ4igFCQYEjwUuOmYkWM5tE=
136136
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.51.3/go.mod h1:ygltZT++6Wn2uG4+tqE0NW1MkdEtb5W2O/CFc0xJX/g=
137137
github.com/aws/aws-sdk-go-v2/service/ec2 v1.210.1 h1:+4A9SDduLZFlDeXWRmfQ6r8kyEJZQfK6lcg+KwdvWrI=
138138
github.com/aws/aws-sdk-go-v2/service/ec2 v1.210.1/go.mod h1:ouvGEfHbLaIlWwpDpOVWPWR+YwO0HDv3vm5tYLq8ImY=
139-
github.com/aws/aws-sdk-go-v2/service/eks v1.63.2 h1:ymoK/RrNf6SAzWCPUk9EdyUAshlmBeF6ZWe6GcS8XBg=
140-
github.com/aws/aws-sdk-go-v2/service/eks v1.63.2/go.mod h1:v1xXy6ea0PHtWkjFUvAUh6B/5wv7UF909Nru0dOIJDk=
141-
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.3 h1:DpyV8LeDf0y7iDaGZ3h1Y+Nh5IaBOR+xj44vVgEEegY=
142-
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.3/go.mod h1:H232HdqVlSUoqy0cMJYW1TKjcxvGFGFZ20xQG8fOAPw=
143-
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.2 h1:vX70Z4lNSr7XsioU0uJq5yvxgI50sB66MvD+V/3buS4=
144-
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.2/go.mod h1:xnCC3vFBfOKpU6PcsCKL2ktgBTZfOwTGxj6V8/X3IS4=
139+
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0 h1:EYeOThTRysemFtC6J6h6b7dNg3jN03QuO5cg92ojIQE=
140+
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0/go.mod h1:v1xXy6ea0PHtWkjFUvAUh6B/5wv7UF909Nru0dOIJDk=
141+
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.2 h1:Zlfmpg4QsduBeiK0vTc8WjnHZoYVGe64FcwuCsipjWE=
142+
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.2/go.mod h1:H232HdqVlSUoqy0cMJYW1TKjcxvGFGFZ20xQG8fOAPw=
143+
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.1 h1:USXR7nfl+bu7HnR/M3KtnPD3wjlCXM72kYX+2PaIgEI=
144+
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.45.1/go.mod h1:xnCC3vFBfOKpU6PcsCKL2ktgBTZfOwTGxj6V8/X3IS4=
145145
github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.12 h1:uH6GOnGSvVN9MCk6o3+HvZFpdqL7AzJKNOTM/6l+3/s=
146146
github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.12/go.mod h1:6qtp53AQg7KEeYrsp430PNlmVVO9qK0Xw8nddE1y+ow=
147147
github.com/aws/aws-sdk-go-v2/service/iam v1.41.1 h1:Kq3R+K49y23CGC5UQF3Vpw5oZEQk5gF/nn+MekPD0ZY=
@@ -1208,8 +1208,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
12081208
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
12091209
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
12101210
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
1211-
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
1212-
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
1211+
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
1212+
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
12131213
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
12141214
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
12151215
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
@@ -1439,8 +1439,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
14391439
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
14401440
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
14411441
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=
1442-
helm.sh/helm/v3 v3.17.2 h1:agYQ5ew2jq5vdx2K7q5W44KyKQrnSubUMCQsjkiv3/o=
1443-
helm.sh/helm/v3 v3.17.2/go.mod h1:+uJKMH/UiMzZQOALR3XUf3BLIoczI2RKKD6bMhPh4G8=
1442+
helm.sh/helm/v3 v3.17.3 h1:3n5rW3D0ArjFl0p4/oWO8IbY/HKaNNwJtOQFdH2AZHg=
1443+
helm.sh/helm/v3 v3.17.3/go.mod h1:+uJKMH/UiMzZQOALR3XUf3BLIoczI2RKKD6bMhPh4G8=
14441444
honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI=
14451445
honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4=
14461446
k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls=

pkg/ami/ssm_resolver.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ func MakeManagedSSMParameterName(version string, amiType ekstypes.AMITypes) stri
115115
return fmt.Sprintf("/aws/service/eks/optimized-ami/%s/%s/x86_64/neuron/recommended/release_version", version, utils.ToKebabCase(api.NodeImageFamilyAmazonLinux2023))
116116
case ekstypes.AMITypesAl2023Arm64Standard:
117117
return fmt.Sprintf("/aws/service/eks/optimized-ami/%s/%s/arm64/standard/recommended/release_version", version, utils.ToKebabCase(api.NodeImageFamilyAmazonLinux2023))
118+
case ekstypes.AMITypesAl2023Arm64Nvidia:
119+
return fmt.Sprintf("/aws/service/eks/optimized-ami/%s/%s/arm64/nvidia/recommended/release_version", version, utils.ToKebabCase(api.NodeImageFamilyAmazonLinux2023))
118120
case ekstypes.AMITypesAl2X8664:
119121
return makeAL2ParameterName("")
120122
case ekstypes.AMITypesAl2X8664Gpu:

pkg/ami/ssm_resolver_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,6 @@ var _ = Describe("AMI Auto Resolution", func() {
757757
var eksAMIType ekstypes.AMITypes
758758
for _, amiType := range eksAMIType.Values() {
759759
if amiType == ekstypes.AMITypesCustom || strings.HasPrefix(string(amiType), "WINDOWS_") ||
760-
// TODO: remove this condition after adding support for AL2023 Nvidia and Neuron AMI types.
761-
amiType == ekstypes.AMITypesAl2023X8664Nvidia || amiType == ekstypes.AMITypesAl2023X8664Neuron ||
762760
// TODO: remove this condition after support for Bottlerocket FIPS AMI types.
763761
amiType == ekstypes.AMITypesBottlerocketArm64Fips || amiType == ekstypes.AMITypesBottlerocketX8664Fips {
764762
continue
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package v1alpha5
2+
3+
import (
4+
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
5+
instanceutils "github.com/weaveworks/eksctl/pkg/utils/instance"
6+
)
7+
8+
// GetAMIType returns the most appropriate amiType for the amiFamily and
9+
// instanceType provided. Parameter `strict` controls whether or not fallbacks
10+
// should be applied when searching for specialized amiTypes (eg. accerated
11+
// instance types). If `strict` is false a fallback may be applied, otherwise a
12+
// valid value is not guaranteed to be returned (empty string).
13+
func GetAMIType(amiFamily, instanceType string, strict bool) ekstypes.AMITypes {
14+
amiTypeMapping := map[string]struct {
15+
X86x64 ekstypes.AMITypes
16+
X86Nvidia ekstypes.AMITypes
17+
X86Neuron ekstypes.AMITypes
18+
ARM ekstypes.AMITypes
19+
ARM64Nvidia ekstypes.AMITypes
20+
ARM64Neuron ekstypes.AMITypes
21+
}{
22+
NodeImageFamilyAmazonLinux2023: {
23+
X86x64: ekstypes.AMITypesAl2023X8664Standard,
24+
X86Nvidia: ekstypes.AMITypesAl2023X8664Nvidia,
25+
X86Neuron: ekstypes.AMITypesAl2023X8664Neuron,
26+
ARM: ekstypes.AMITypesAl2023Arm64Standard,
27+
ARM64Nvidia: ekstypes.AMITypesAl2023Arm64Nvidia,
28+
},
29+
NodeImageFamilyAmazonLinux2: {
30+
X86x64: ekstypes.AMITypesAl2X8664,
31+
X86Nvidia: ekstypes.AMITypesAl2X8664Gpu,
32+
X86Neuron: ekstypes.AMITypesAl2X8664Gpu,
33+
ARM: ekstypes.AMITypesAl2Arm64,
34+
},
35+
NodeImageFamilyBottlerocket: {
36+
X86x64: ekstypes.AMITypesBottlerocketX8664,
37+
X86Nvidia: ekstypes.AMITypesBottlerocketX8664Nvidia,
38+
X86Neuron: ekstypes.AMITypesBottlerocketX8664,
39+
ARM: ekstypes.AMITypesBottlerocketArm64,
40+
ARM64Nvidia: ekstypes.AMITypesBottlerocketArm64Nvidia,
41+
ARM64Neuron: ekstypes.AMITypesBottlerocketArm64,
42+
},
43+
NodeImageFamilyWindowsServer2019FullContainer: {
44+
X86x64: ekstypes.AMITypesWindowsFull2019X8664,
45+
X86Nvidia: ekstypes.AMITypesWindowsFull2019X8664,
46+
},
47+
NodeImageFamilyWindowsServer2019CoreContainer: {
48+
X86x64: ekstypes.AMITypesWindowsCore2019X8664,
49+
X86Nvidia: ekstypes.AMITypesWindowsCore2019X8664,
50+
},
51+
NodeImageFamilyWindowsServer2022FullContainer: {
52+
X86x64: ekstypes.AMITypesWindowsFull2022X8664,
53+
X86Nvidia: ekstypes.AMITypesWindowsFull2022X8664,
54+
},
55+
NodeImageFamilyWindowsServer2022CoreContainer: {
56+
X86x64: ekstypes.AMITypesWindowsCore2022X8664,
57+
X86Nvidia: ekstypes.AMITypesWindowsCore2022X8664,
58+
},
59+
}
60+
61+
amiType, ok := amiTypeMapping[amiFamily]
62+
if !ok {
63+
return ekstypes.AMITypesCustom
64+
}
65+
66+
// this helper short circuits the check for missing entries for amiTypes in
67+
// ami families based on the value of `strict`.
68+
isValid := func(amiType ekstypes.AMITypes) bool {
69+
return strict || amiType != ""
70+
}
71+
72+
if instanceutils.IsARMInstanceType(instanceType) {
73+
switch {
74+
case instanceutils.IsNvidiaInstanceType(instanceType) && isValid(amiType.ARM64Nvidia):
75+
return amiType.ARM64Nvidia
76+
case instanceutils.IsNeuronInstanceType(instanceType) && isValid(amiType.ARM64Neuron):
77+
return amiType.ARM64Neuron
78+
default:
79+
return amiType.ARM
80+
}
81+
} else {
82+
switch {
83+
case instanceutils.IsNvidiaInstanceType(instanceType) && isValid(amiType.X86Nvidia):
84+
return amiType.X86Nvidia
85+
case instanceutils.IsNeuronInstanceType(instanceType) && isValid(amiType.X86Neuron):
86+
return amiType.X86Neuron
87+
default:
88+
return amiType.X86x64
89+
}
90+
}
91+
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,6 +1840,11 @@
18401840
"description": "Enable EC2 detailed monitoring",
18411841
"x-intellij-html-description": "Enable EC2 detailed monitoring"
18421842
},
1843+
"enclaveEnabled": {
1844+
"type": "boolean",
1845+
"description": "determines if the EC2 instance will be Nitro enclave enabled",
1846+
"x-intellij-html-description": "determines if the EC2 instance will be Nitro enclave enabled"
1847+
},
18431848
"iam": {
18441849
"$ref": "#/definitions/NodeGroupIAM"
18451850
},
@@ -2068,7 +2073,8 @@
20682073
"kubeletExtraConfig",
20692074
"containerRuntime",
20702075
"maxInstanceLifetime",
2071-
"localZones"
2076+
"localZones",
2077+
"enclaveEnabled"
20722078
],
20732079
"additionalProperties": false,
20742080
"description": "holds configuration attributes that are specific to an unmanaged nodegroup",

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types"
1212

1313
"github.com/weaveworks/eksctl/pkg/utils"
14-
instanceutils "github.com/weaveworks/eksctl/pkg/utils/instance"
1514
)
1615

1716
const (
@@ -149,8 +148,8 @@ func SetManagedNodeGroupDefaults(ng *ManagedNodeGroup, meta *ClusterMeta, contro
149148
// When using custom AMIs, we want the user to explicitly specify AMI family.
150149
// Thus, we only set up default AMI family when no custom AMI is being used.
151150
if ng.AMIFamily == "" && ng.AMI == "" {
152-
if isMinVer, _ := utils.IsMinVersion(Version1_30, meta.Version); isMinVer &&
153-
!instanceutils.IsARMGPUInstanceType(ng.InstanceType) {
151+
// AL2023 is the default ami type on EKS managed nodegroups after 1.30.
152+
if isMinVer, _ := utils.IsMinVersion(Version1_30, meta.Version); isMinVer {
154153
ng.AMIFamily = NodeImageFamilyAmazonLinux2023
155154
} else {
156155
ng.AMIFamily = NodeImageFamilyAmazonLinux2

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ var _ = Describe("GPU instance support", func() {
5151
amiFamily: api.NodeImageFamilyAmazonLinux2023,
5252
gpuInstanceType: "g4dn.xlarge",
5353
}),
54+
Entry("AL2023 ARM NVIDIA", gpuInstanceEntry{
55+
amiFamily: api.NodeImageFamilyAmazonLinux2023,
56+
gpuInstanceType: "g5g.2xlarge",
57+
}),
5458
Entry("AL2", gpuInstanceEntry{
5559
gpuInstanceType: "asdf",
5660
amiFamily: api.NodeImageFamilyAmazonLinux2,
@@ -96,7 +100,6 @@ var _ = Describe("GPU instance support", func() {
96100
ng.InstanceType = e.gpuInstanceType
97101
ng.AMIFamily = e.amiFamily
98102
assertValidationError(e, api.ValidateNodeGroup(0, ng, api.NewClusterConfig()))
99-
100103
},
101104
Entry("AL2023 INF", gpuInstanceEntry{
102105
amiFamily: api.NodeImageFamilyAmazonLinux2023,
@@ -110,6 +113,10 @@ var _ = Describe("GPU instance support", func() {
110113
amiFamily: api.NodeImageFamilyAmazonLinux2023,
111114
gpuInstanceType: "g4dn.xlarge",
112115
}),
116+
Entry("AL2023 ARM NVIDIA", gpuInstanceEntry{
117+
amiFamily: api.NodeImageFamilyAmazonLinux2023,
118+
gpuInstanceType: "g5g.2xlarge",
119+
}),
113120
Entry("AL2", gpuInstanceEntry{
114121
gpuInstanceType: "g4dn.xlarge",
115122
amiFamily: api.NodeImageFamilyAmazonLinux2,
@@ -244,16 +251,11 @@ var _ = Describe("GPU instance support", func() {
244251
amiFamily := api.NodeImageFamilyAmazonLinux2023
245252
instanceType := "g5g.2xlarge"
246253

247-
ngFail := api.NewNodeGroup()
248-
ngFail.AMIFamily = amiFamily
249-
ngFail.InstanceType = instanceType
250-
251254
ngPass := api.NewNodeGroup()
252255
ngPass.AMIFamily = amiFamily
253256
ngPass.InstanceType = instanceType
254257
ngPass.AMI = "ami-xxxx"
255258

256-
Expect(api.ValidateNodeGroup(0, ngFail, api.NewClusterConfig())).To(HaveOccurred())
257259
Expect(api.ValidateNodeGroup(0, ngPass, api.NewClusterConfig())).NotTo(HaveOccurred())
258260
})
259261

@@ -263,14 +265,14 @@ var _ = Describe("GPU instance support", func() {
263265
ng.AMIFamily = amiFamily
264266
err := api.ValidateNodeGroup(0, ng, api.NewClusterConfig())
265267
if expectErr {
266-
Expect(err).To(MatchError(fmt.Sprintf("ARM GPU instance types are not supported for unmanaged nodegroups with AMIFamily %s", amiFamily)))
268+
Expect(err).To(MatchError(fmt.Sprintf("%s instance types are not supported for unmanaged nodegroups with AMIFamily %s", ng.InstanceType, amiFamily)))
267269
} else {
268270
Expect(err).NotTo(HaveOccurred())
269271
}
270272
},
271273
Entry("AmazonLinux2", api.NodeImageFamilyAmazonLinux2, true),
272-
Entry("AmazonLinux2023", api.NodeImageFamilyAmazonLinux2023, true),
273-
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, true),
274+
Entry("AmazonLinux2023", api.NodeImageFamilyAmazonLinux2023, false),
275+
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, false),
274276
Entry("Windows2019Full", api.NodeImageFamilyWindowsServer2019FullContainer, true),
275277
Entry("Windows2019Core", api.NodeImageFamilyWindowsServer2019CoreContainer, true),
276278
Entry("Bottlerocket", api.NodeImageFamilyBottlerocket, false),

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,10 @@ type NodeGroup struct {
13321332
// The cluster should have been created with all of the local zones specified in this field.
13331333
// +optional
13341334
LocalZones []string `json:"localZones,omitempty"`
1335+
1336+
// EnclaveEnabled determines if the EC2 instance will be Nitro enclave enabled
1337+
// +optional
1338+
EnclaveEnabled *bool `json:"enclaveEnabled,omitempty"`
13351339
}
13361340

13371341
// GetContainerRuntime returns the container runtime.

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,12 +1079,10 @@ func validateInstanceTypeSupport(ng *NodeGroup) error {
10791079
if IsAMI(ng.AMI) {
10801080
return nil
10811081
}
1082-
if instanceutils.IsARMGPUInstanceType(SelectInstanceType(ng)) {
1083-
switch ng.AMIFamily {
1084-
case NodeImageFamilyBottlerocket:
1085-
default:
1086-
return fmt.Errorf("ARM GPU instance types are not supported for unmanaged nodegroups with AMIFamily %s", ng.AMIFamily)
1087-
}
1082+
instanceType := SelectInstanceType(ng)
1083+
amiType := GetAMIType(ng.AMIFamily, instanceType, true /* strict, don't allows fallbacks */)
1084+
if amiType == "" {
1085+
return fmt.Errorf("%s instance types are not supported for unmanaged nodegroups with AMIFamily %s", instanceType, ng.AMIFamily)
10881086
}
10891087
return nil
10901088
}

0 commit comments

Comments
 (0)