Skip to content

Commit de74c5b

Browse files
committed
add validation error for maxpods limitation
1 parent f5932a0 commit de74c5b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,10 @@ func ValidateManagedNodeGroup(index int, ng *ManagedNodeGroup) error {
11871187
}
11881188
}
11891189

1190+
if ng.AMIFamily == NodeImageFamilyAmazonLinux2023 && ng.MaxPodsPerNode > 0 {
1191+
return errors.Errorf("eksctl does not support configuring maxPodsPerNode EKS-managed nodes based on %s", NodeImageFamilyAmazonLinux2023)
1192+
}
1193+
11901194
if ng.AMIFamily == NodeImageFamilyBottlerocket {
11911195
fieldNotSupported := func(field string) error {
11921196
return &unsupportedFieldError{

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,6 +2092,16 @@ var _ = Describe("ClusterConfig validation", func() {
20922092
})
20932093
})
20942094

2095+
Describe("AmazonLinux2023 node groups", func() {
2096+
It("returns an error when setting maxPodsPerNode for managed nodegroups", func() {
2097+
ng := api.NewManagedNodeGroup()
2098+
ng.AMIFamily = api.NodeImageFamilyAmazonLinux2023
2099+
ng.MaxPodsPerNode = 5
2100+
err := api.ValidateManagedNodeGroup(0, ng)
2101+
Expect(err).To(MatchError(ContainSubstring("eksctl does not support configuring maxPodsPerNode EKS-managed nodes")))
2102+
})
2103+
})
2104+
20952105
Describe("Windows node groups", func() {
20962106
It("returns an error with unsupported fields", func() {
20972107
doc := api.InlineDocument{

0 commit comments

Comments
 (0)