diff --git a/pkg/providers/amifamily/al2023.go b/pkg/providers/amifamily/al2023.go index bde9161b0be9..dc092717c96e 100644 --- a/pkg/providers/amifamily/al2023.go +++ b/pkg/providers/amifamily/al2023.go @@ -78,16 +78,15 @@ func (a AL2023) resolvePath(architecture, variant, k8sVersion, amiVersion string func (a AL2023) UserData(kubeletConfig *v1.KubeletConfiguration, taints []corev1.Taint, labels map[string]string, caBundle *string, _ []*cloudprovider.InstanceType, customUserData *string, instanceStorePolicy *v1.InstanceStorePolicy) bootstrap.Bootstrapper { return bootstrap.Nodeadm{ Options: bootstrap.Options{ - ClusterName: a.Options.ClusterName, - ClusterEndpoint: a.Options.ClusterEndpoint, - ClusterCIDR: a.Options.ClusterCIDR, - KubeletConfig: kubeletConfig, - Taints: taints, - Labels: labels, - CABundle: caBundle, - AWSENILimitedPodDensity: false, - CustomUserData: customUserData, - InstanceStorePolicy: instanceStorePolicy, + ClusterName: a.Options.ClusterName, + ClusterEndpoint: a.Options.ClusterEndpoint, + ClusterCIDR: a.Options.ClusterCIDR, + KubeletConfig: kubeletConfig, + Taints: taints, + Labels: labels, + CABundle: caBundle, + CustomUserData: customUserData, + InstanceStorePolicy: instanceStorePolicy, }, } } diff --git a/pkg/providers/amifamily/bootstrap/bootstrap.go b/pkg/providers/amifamily/bootstrap/bootstrap.go index 052ac10a2510..b088a540818a 100644 --- a/pkg/providers/amifamily/bootstrap/bootstrap.go +++ b/pkg/providers/amifamily/bootstrap/bootstrap.go @@ -28,17 +28,16 @@ import ( // Options is the node bootstrapping parameters passed from Karpenter to the provisioning node type Options struct { - ClusterName string - ClusterEndpoint string - ClusterCIDR *string - KubeletConfig *v1.KubeletConfiguration - Taints []corev1.Taint `hash:"set"` - Labels map[string]string `hash:"set"` - CABundle *string - AWSENILimitedPodDensity bool - ContainerRuntime *string - CustomUserData *string - InstanceStorePolicy *v1.InstanceStorePolicy + ClusterName string + ClusterEndpoint string + ClusterCIDR *string + KubeletConfig *v1.KubeletConfiguration + Taints []corev1.Taint `hash:"set"` + Labels map[string]string `hash:"set"` + CABundle *string + ContainerRuntime *string + CustomUserData *string + InstanceStorePolicy *v1.InstanceStorePolicy } func (o Options) kubeletExtraArgs() (args []string) { diff --git a/pkg/providers/amifamily/bootstrap/bottlerocket.go b/pkg/providers/amifamily/bootstrap/bottlerocket.go index f7dbddd1b9e3..d461e1adf22e 100644 --- a/pkg/providers/amifamily/bootstrap/bottlerocket.go +++ b/pkg/providers/amifamily/bootstrap/bottlerocket.go @@ -44,11 +44,8 @@ func (b Bottlerocket) Script() (string, error) { return "", err } - // Backwards compatibility for AWSENILimitedPodDensity flag if b.KubeletConfig != nil && b.KubeletConfig.MaxPods != nil { s.Settings.Kubernetes.MaxPods = aws.Int(int(lo.FromPtr(b.KubeletConfig.MaxPods))) - } else if !b.AWSENILimitedPodDensity { - s.Settings.Kubernetes.MaxPods = aws.Int(110) } if b.KubeletConfig != nil { diff --git a/pkg/providers/amifamily/bootstrap/eksbootstrap.go b/pkg/providers/amifamily/bootstrap/eksbootstrap.go index 9c0a53ccf2fe..96ffa534b0e5 100644 --- a/pkg/providers/amifamily/bootstrap/eksbootstrap.go +++ b/pkg/providers/amifamily/bootstrap/eksbootstrap.go @@ -71,7 +71,7 @@ func (e EKS) eksBootstrapScript() string { if e.KubeletConfig != nil && len(e.KubeletConfig.ClusterDNS) > 0 { userData.WriteString(fmt.Sprintf(" \\\n--dns-cluster-ip '%s'", e.KubeletConfig.ClusterDNS[0])) } - if (e.KubeletConfig != nil && e.KubeletConfig.MaxPods != nil) || !e.AWSENILimitedPodDensity { + if e.KubeletConfig != nil && e.KubeletConfig.MaxPods != nil { userData.WriteString(" \\\n--use-max-pods false") } if args := e.kubeletExtraArgs(); len(args) > 0 { @@ -83,17 +83,6 @@ func (e EKS) eksBootstrapScript() string { return userData.String() } -// kubeletExtraArgs for the EKS bootstrap.sh script uses the concept of ENI-limited pod density to set pods -// If this argument is explicitly disabled, then set the max-pods value on the kubelet to the static value of 110 -func (e EKS) kubeletExtraArgs() []string { - args := e.Options.kubeletExtraArgs() - // Set the static value for --max-pods to 110 when AWSENILimitedPodDensity is explicitly disabled and the value isn't set - if !e.AWSENILimitedPodDensity && (e.KubeletConfig == nil || e.KubeletConfig.MaxPods == nil) { - args = append(args, "--max-pods=110") - } - return args -} - func (e EKS) mergeCustomUserData(userDatas ...string) (string, error) { var outputBuffer bytes.Buffer writer := multipart.NewWriter(&outputBuffer) diff --git a/pkg/providers/launchtemplate/suite_test.go b/pkg/providers/launchtemplate/suite_test.go index b91033a2d6be..2797432aa1ee 100644 --- a/pkg/providers/launchtemplate/suite_test.go +++ b/pkg/providers/launchtemplate/suite_test.go @@ -465,7 +465,6 @@ var _ = Describe("LaunchTemplate Provider", func() { {Taints: []corev1.Taint{{Key: "test-key", Value: "test-value"}}}, {Labels: map[string]string{"test-key": "test-value"}}, {CABundle: lo.ToPtr("test-bundle")}, - {AWSENILimitedPodDensity: true}, {ContainerRuntime: lo.ToPtr("test-cri")}, {CustomUserData: lo.ToPtr("test-cidr")}, } @@ -474,7 +473,7 @@ var _ = Describe("LaunchTemplate Provider", func() { lt := &amifamily.LaunchTemplate{UserData: bootstrap.EKS{Options: *option}} launchtemplateResult = append(launchtemplateResult, launchtemplate.LaunchTemplateName(lt)) } - Expect(len(launchtemplateResult)).To(BeNumerically("==", 10)) + Expect(len(launchtemplateResult)).To(BeNumerically("==", 9)) Expect(lo.Uniq(launchtemplateResult)).To(Equal(launchtemplateResult)) }) It("should generate different launch template names based on launchtemplate option configuration", func() {