diff --git a/pkg/ami/auto_resolver.go b/pkg/ami/auto_resolver.go index 46bb8d98b8..340267ab3b 100644 --- a/pkg/ami/auto_resolver.go +++ b/pkg/ami/auto_resolver.go @@ -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), @@ -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), @@ -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 diff --git a/pkg/ami/ssm_resolver.go b/pkg/ami/ssm_resolver.go index edfaad6dc1..e37fd1d104 100644 --- a/pkg/ami/ssm_resolver.go +++ b/pkg/ami/ssm_resolver.go @@ -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) } @@ -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" } @@ -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)} } diff --git a/pkg/apis/eksctl.io/v1alpha5/types.go b/pkg/apis/eksctl.io/v1alpha5/types.go index 95b46517c7..5fd9f8831f 100644 --- a/pkg/apis/eksctl.io/v1alpha5/types.go +++ b/pkg/apis/eksctl.io/v1alpha5/types.go @@ -212,6 +212,8 @@ const ( DefaultNodeImageFamily = NodeImageFamilyAmazonLinux2023 NodeImageFamilyAmazonLinux2023 = "AmazonLinux2023" NodeImageFamilyAmazonLinux2 = "AmazonLinux2" + NodeImageFamilyUbuntuPro2604 = "UbuntuPro2604" + NodeImageFamilyUbuntu2604 = "Ubuntu2604" NodeImageFamilyUbuntuPro2404 = "UbuntuPro2404" NodeImageFamilyUbuntu2404 = "Ubuntu2404" NodeImageFamilyUbuntuPro2204 = "UbuntuPro2204" @@ -598,6 +600,8 @@ func SupportedAMIFamilies() []string { return []string{ NodeImageFamilyAmazonLinux2023, NodeImageFamilyAmazonLinux2, + NodeImageFamilyUbuntuPro2604, + NodeImageFamilyUbuntu2604, NodeImageFamilyUbuntuPro2404, NodeImageFamilyUbuntu2404, NodeImageFamilyUbuntuPro2204, diff --git a/pkg/apis/eksctl.io/v1alpha5/validation.go b/pkg/apis/eksctl.io/v1alpha5/validation.go index b6cf69653f..9f96df708c 100644 --- a/pkg/apis/eksctl.io/v1alpha5/validation.go +++ b/pkg/apis/eksctl.io/v1alpha5/validation.go @@ -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, diff --git a/pkg/nodebootstrap/userdata.go b/pkg/nodebootstrap/userdata.go index b4de32fa38..5814141918 100644 --- a/pkg/nodebootstrap/userdata.go +++ b/pkg/nodebootstrap/userdata.go @@ -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 @@ -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