-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] maxPodsPerNode does't work with eks 1.22 #5134
Comments
Hello, can you please also verify that the created launch template's user data contains MAX_POD setting to 12? |
Looks like it. This is the user data:
|
Okay cool. That's something at least. :) We'll take a look, but if we provide the right flags, I'm afraid there is little we can do. Have you tried testing it with more than 12 pods? It might write 29, but it might not allow more than 12 using the controller, or something something AWS magic? :) |
Fair enough, it could be something that changed within EKS. I did test it already, unfortunatly, there was no AWS magic, and I ended up with about 27 pods. That's how I noticed the issue. |
Thanks! |
I initially suspected that the script eksctl uses to set max pods for managed nodegroups no longer works in EKS 1.22, potentially because the bootstrap script in 1.22 AMIs has changed. But after testing, I can confirm that eksctl is still able to set |
I have tracked it down to EKS supplying We can also work around this but we'll discuss this with the EKS team first as there were some talks about deprecating max pods earlier. |
Thanks for the update! In the meantime, we could work around the issue by setting resource requests on our pods, instead of setting a hardcoded number of pods. We have been thinking about it for a while anyway, that was just the push we needed to take the time and do it. |
@matthewdepietro tagging you here as per your request 👍🏻 |
Adding some context on Managed Nodegroups' behavior - if the VPC CNI is running on >= 1.9, Managed Nodegroups attempts to auto-calculate the value of maxPods and sets it on the kubelet as @cPu1 has found. Managed Nodegroups will look at the different environment variables on the VPC CNI to determine what value to set (it essentially emulates the logic in this calculator script). It takes into account PrefixDelegation, Max ENIs etc. This logic should only be triggered when the ManagedNodegroups is being created without a custom AMI. When looking to override kubelet config, it's recommended to specify an AMI in the launch template passed to |
We need to come up with a plan to support this as cleanly as possible without hacks. Timebox: 1-2 days |
Looking into this more, a clean solution to support max pods in eksctl is to resolve the AMI using SSM, passing it as a custom AMI to the MNG API, and use a custom bootstrap script, setting |
Alternatively, we can use a workaround/hack that modifies the bootstrap.sh script and removes the |
This is the approach I'd be in favor of. I'm not sure I understood the mechanics of the workaround you'd mentioned. I think you meant you could edit the bootstrap script on the AMI itself and remove the max-pods argument that MNG API tries to set, but I'm not sure I understand how eksctl would set the value of In the long term, we've been thinking of rewriting the EKS bootstrap script so that kubelet parameter overrides can be specified within your UserData section, and it'll be honored by however MNG bootstraps, but it's pending resourcing. |
I am inclined to this approach as well instead of breaking |
Correct.
eksctl will set it in the kubelet config, which will then be read by kubelet.
Thanks for sharing this. I think we'll go with the workaround for now, given that we already have a similar workaround in place and it requires less effort than using a custom AMI with a custom bootstrap script. We'll revisit this approach after the EKS bootstrap script starts accepting kubelet parameter overrides. |
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. |
Just dumping this for reference: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/user_data.md#%EF%B8%8F-caveat Also, maxPodsPerNode does not seem to work with latest 1.21 AMIs anymore (awslabs/amazon-eks-ami@v20220824...v20220914). I am using this in new created clusters and its still working awslabs/amazon-eks-ami#844 (comment) (tested on 1.21, 1.22 and 1.23). EDIT: It seems that is working again in 1.21 for me with ami-051aa0d5889741142 (EKS 1.21/us-east-2) as of 2022/10/07. |
This was fixed by #5808. You should not run into this issue with a recent version of eksctl. |
@cPu1 are you sure that the fix in https://github.com/weaveworks/eksctl/pull/5808/files#diff-3a316f46904258df0dec1e9c9c1d6a89efb06e0637a5c0a6a930c162b5352498R99 is called - the |
okay it does set it, but kubelet is running with |
What were you trying to accomplish?
I'm trying to create a managed node group with a limit on the number of pods per node.
What happened?
The node group is created but
maxPodsPerNode
is ignored and the nodes use their default value instead (29 in my case for a m5.large node).How to reproduce it?
Logs
Creation log
kubect describe node/ip-10-75-1-120.ca-central-1.compute.internal
Anything else we need to know?
Debian 11 with downloaded 0.93.0 binary
Versions
The text was updated successfully, but these errors were encountered: