eksctl-io / eksctl

The official CLI for Amazon EKS
https://eksctl.io
Other
4.93k stars 1.41k forks source link

[Bug] KubeletExtraConfig will be ignore when using custom AMI with self-managed node group #5995

Closed yws-ss closed 1 year ago

yws-ss commented 1 year ago

What were you trying to accomplish?

Create a self-managed node group with custom AMI. Also, configure the kubeletReserved/SystemReserved through KubeletExtraConfig

What happened?

According to new announcement, eksctl decided to remove the eksctl's bootstrap script for custom AMI with node group. Therefore, in order to early adopt this change, we follow the guideline to add overrideBootstrapCommand. Following is my current YAML:

nodeGroups:
  - instanceType: c5.2xlarge
    overrideBootstrapCommand: |
     #!/bin/bash

      source /var/lib/cloud/scripts/eksctl/bootstrap.helper.sh

      /etc/eks/bootstrap.sh ${CLUSTER_NAME} --container-runtime containerd --kubelet-extra-args "--node-labels=${NODE_LABELS}"
    labels: { role: workers, eks.amazonaws.com/nodegroup: ng-02}
    name: ng-02
    minSize: 2
    maxSize: 10
    desiredCapacity: 2
    volumeSize: 100
    volumeType: gp3
    volumeIOPS: 4500
    volumeThroughput: 300
    privateNetworking: true
    disableIMDSv1: true
    disablePodIMDS: true
    kubeletExtraConfig:
        kubeReserved:
            cpu: "300m"
            memory: "300Mi"
            ephemeral-storage: "1Gi"
        kubeReservedCgroup: "/kube-reserved"
        systemReserved:
            cpu: "300m"
            memory: "300Mi"
            ephemeral-storage: "1Gi"
        evictionHard:
            memory.available:  "200Mi"
            nodefs.available: "10%"
        featureGates:
            RotateKubeletServerCertificate: true

However, we found that this behavior would lead the KubeletExtraConfig doesn't merge the extra configuration into kubelet config which EKS Optimized AMI already contain. Which mean, the configuration wouldn't effect.

How to reproduce it?

Create a node group with above YAML configuration.

Logs

Anything else we need to know?

Versions


$ eksctl info
eksctl version: 0.121.0
kubectl version: v1.22.6-eks-7d68063
OS: linux```
github-actions[bot] commented 1 year ago

Hello yws-ss :wave: Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-5 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

yws-ss commented 1 year ago

Not sure it related with https://github.com/awslabs/amazon-eks-ami/issues/873 or not

cPu1 commented 1 year ago

@yws-ss, This is indeed a bug. While eksctl does generate a file with the contents of kubeletExtraConfig, it isn't used or being passed to the kubelet. We've added this to our backlog and will work on it soon.

Not sure it related with https://github.com/awslabs/amazon-eks-ami/issues/873 or not

I believe this was created to help add support for kubeletExtraConfig in managed nodegroups.

yws-ss commented 1 year ago

@cPu1 , as this could not be fixed as soon as possible, should we add some note or modify the eksctl doc to bring this to user.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.