Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pkg/ami/auto_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
ImageClassNeuron: fmt.Sprintf("amazon-eks-gpu-node-%s-*", version),
ImageClassARM: fmt.Sprintf("amazon-eks-arm64-node-%s-*", version),
},
api.NodeImageFamilyUbuntuPro2604: {
ImageClassGeneral: fmt.Sprintf("ubuntu-eks-pro/k8s_%s/images/*26.04-amd64*", version),
ImageClassARM: fmt.Sprintf("ubuntu-eks-pro/k8s_%s/images/*26.04-arm64*", version),
},
api.NodeImageFamilyUbuntuPro2404: {
ImageClassGeneral: fmt.Sprintf("ubuntu-eks-pro/k8s_%s/images/*24.04-amd64*", version),
ImageClassARM: fmt.Sprintf("ubuntu-eks-pro/k8s_%s/images/*24.04-arm64*", version),
Expand All @@ -47,6 +51,10 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
ImageClassGeneral: fmt.Sprintf("ubuntu-eks-pro/k8s_%s/images/*20.04-amd64*", version),
ImageClassARM: fmt.Sprintf("ubuntu-eks-pro/k8s_%s/images/*20.04-arm64*", version),
},
api.NodeImageFamilyUbuntu2604: {
ImageClassGeneral: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*26.04-amd64*", version),
ImageClassARM: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*26.04-arm64*", version),
},
api.NodeImageFamilyUbuntu2404: {
ImageClassGeneral: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*24.04-amd64*", version),
ImageClassARM: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*24.04-arm64*", version),
Expand Down Expand Up @@ -83,7 +91,7 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
// OwnerAccountID returns the AWS account ID that owns worker AMI.
func OwnerAccountID(imageFamily, region string) (string, error) {
switch imageFamily {
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004:
case api.NodeImageFamilyUbuntuPro2604, api.NodeImageFamilyUbuntu2604, api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004:
return ownerIDUbuntuFamily, nil
case api.NodeImageFamilyAmazonLinux2023, api.NodeImageFamilyAmazonLinux2:
return api.EKSResourceAccountID(region), nil
Expand Down
23 changes: 23 additions & 0 deletions pkg/ami/ssm_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ func MakeSSMParameterName(version, instanceType, imageFamily string) (string, er
eksProduct = "eks-pro"
}
return fmt.Sprint("/aws/service/canonical/ubuntu/", eksProduct, "/", ubuntuReleaseName(imageFamily), "/", version, "/stable/current/", ubuntuArchName(instanceType), "/hvm/ebs-gp3/ami-id"), nil
case api.NodeImageFamilyUbuntu2604,
api.NodeImageFamilyUbuntuPro2604:
if err := validateVersionForUbuntu(version, imageFamily); err != nil {
return "", err
}
eksProduct := "eks"
if imageFamily == api.NodeImageFamilyUbuntuPro2604 {
eksProduct = "eks-pro"
}
return fmt.Sprint("/aws/service/canonical/ubuntu/", eksProduct, "/", ubuntuReleaseName(imageFamily), "/", version, "/stable/current/", ubuntuArchName(instanceType), "/hvm/ebs-gp3/ami-id"), nil
default:
return "", fmt.Errorf("unknown image family %s", imageFamily)
}
Expand Down Expand Up @@ -201,6 +211,8 @@ func ubuntuReleaseName(imageFamily string) string {
return "22.04"
case api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2404:
return "24.04"
case api.NodeImageFamilyUbuntu2604, api.NodeImageFamilyUbuntuPro2604:
return "26.04"
default:
return "18.04"
}
Expand Down Expand Up @@ -268,6 +280,17 @@ func validateVersionForUbuntu(version, imageFamily string) error {
if !supportsUbuntu {
return &UnsupportedQueryError{msg: fmt.Sprintf("%s requires EKS version greater or equal than %s", imageFamily, minVersion)}
}
case api.NodeImageFamilyUbuntu2604, api.NodeImageFamilyUbuntuPro2604:
var err error
supportsUbuntu := false
const minVersion = api.Version1_35
supportsUbuntu, err = utils.IsMinVersion(minVersion, version)
if err != nil {
return err
}
if !supportsUbuntu {
return &UnsupportedQueryError{msg: fmt.Sprintf("%s requires EKS version greater or equal than %s", imageFamily, minVersion)}
}
default:
return &UnsupportedQueryError{msg: fmt.Sprintf("SSM Parameter lookups for %s AMIs is not supported", imageFamily)}
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ const (
DefaultNodeImageFamily = NodeImageFamilyAmazonLinux2023
NodeImageFamilyAmazonLinux2023 = "AmazonLinux2023"
NodeImageFamilyAmazonLinux2 = "AmazonLinux2"
NodeImageFamilyUbuntuPro2604 = "UbuntuPro2604"
NodeImageFamilyUbuntu2604 = "Ubuntu2604"
NodeImageFamilyUbuntuPro2404 = "UbuntuPro2404"
NodeImageFamilyUbuntu2404 = "Ubuntu2404"
NodeImageFamilyUbuntuPro2204 = "UbuntuPro2204"
Expand Down Expand Up @@ -598,6 +600,8 @@ func SupportedAMIFamilies() []string {
return []string{
NodeImageFamilyAmazonLinux2023,
NodeImageFamilyAmazonLinux2,
NodeImageFamilyUbuntuPro2604,
NodeImageFamilyUbuntu2604,
NodeImageFamilyUbuntuPro2404,
NodeImageFamilyUbuntu2404,
NodeImageFamilyUbuntuPro2204,
Expand Down
4 changes: 3 additions & 1 deletion pkg/apis/eksctl.io/v1alpha5/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,9 @@ func IsBottlerocketImage(imageFamily string) bool {

func IsUbuntuImage(imageFamily string) bool {
switch imageFamily {
case NodeImageFamilyUbuntuPro2404,
case NodeImageFamilyUbuntuPro2604,
NodeImageFamilyUbuntu2604,
NodeImageFamilyUbuntuPro2404,
NodeImageFamilyUbuntu2404,
NodeImageFamilyUbuntuPro2204,
NodeImageFamilyUbuntu2204,
Expand Down
4 changes: 2 additions & 2 deletions pkg/nodebootstrap/userdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewBootstrapper(clusterConfig *api.ClusterConfig, ng *api.NodeGroup) (Boots
return NewWindowsBootstrapper(clusterConfig, ng, clusterDNS), nil
}
switch ng.AMIFamily {
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004:
case api.NodeImageFamilyUbuntuPro2604, api.NodeImageFamilyUbuntu2604, api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004:
return NewUbuntuBootstrapper(clusterConfig, ng, clusterDNS), nil
case api.NodeImageFamilyBottlerocket:
return NewBottlerocketBootstrapper(clusterConfig, ng), nil
Expand Down Expand Up @@ -78,7 +78,7 @@ func NewManagedBootstrapper(clusterConfig *api.ClusterConfig, ng *api.ManagedNod
return NewManagedAL2Bootstrapper(ng), nil
case api.NodeImageFamilyBottlerocket:
return NewManagedBottlerocketBootstrapper(clusterConfig, ng), nil
case api.NodeImageFamilyUbuntu2004, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2404:
case api.NodeImageFamilyUbuntu2004, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2604, api.NodeImageFamilyUbuntuPro2604:
return NewUbuntuBootstrapper(clusterConfig, ng, clusterDNS), nil
}
return nil, nil
Expand Down
Loading