Skip to content
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

Maximum number of pods per instance type #691

Open
waldner opened this issue Apr 27, 2023 · 2 comments
Open

Maximum number of pods per instance type #691

waldner opened this issue Apr 27, 2023 · 2 comments
Assignees
Labels
Data request Data provided by AWS that should be included.

Comments

@waldner
Copy link

waldner commented Apr 27, 2023

Although it's a number that can be calculated from existing data, would it be possible to add the information from this document: https://github.com/awslabs/amazon-eks-ami/blob/master/files/eni-max-pods.txt ?

Thanks!

@waldner waldner changed the title imum number of pods per instance type Maximum number of pods per instance type Apr 27, 2023
@EverettBerry
Copy link
Contributor

Thanks for bringing this up. We've actually gone back and forth on what the right choice is here. #553 This will be pretty easy to add.

@EverettBerry EverettBerry self-assigned this Apr 28, 2023
@EverettBerry EverettBerry added the Data request Data provided by AWS that should be included. label Apr 28, 2023
@sschamp
Copy link

sschamp commented May 17, 2024

This has now moved to https://github.com/aws/amazon-vpc-cni-k8s/blob/master/misc/eni-max-pods.txt
Any word on this?

You could try to calculate it, and the formula would be Max IPs - Max ENIs + 2
(You could also do Max ENIs * (IPs per ENI - 1) + 2, it equates to the same.
See https://stackoverflow.com/questions/57970896/pod-limit-on-node-aws-eks)
And that works for 99% of the Instances Types, but for some exotic Instance Types that does not work, eg:

image

So best is to just look up in the table at https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/master/misc/eni-max-pods.txt

This would be of great help, as right I can find the ideal Instance Types for my k8s, and when I want to use them, I get errors because I can't place all my pods on them. (we have many pods that require little CPU and RAM, and for a Dev Cluster we only need 3 Nodes..)

There is also this script which is present on all managed nodes:

/etc/eks/max-pods-calculator.sh --help
usage: /etc/eks/max-pods-calculator.sh <instance(s)> [options]
Calculates maxPods value to be used when starting up the kubelet.
-h,--help print this help.
--instance-type Specify the instance type to calculate max pods value.
--instance-type-from-imds Use this flag if the instance type should be fetched from IMDS.
--cni-version Specify the version of the CNI (example - 1.7.5).
--cni-custom-networking-enabled Use this flag to indicate if CNI custom networking mode has been enabled.
--cni-prefix-delegation-enabled Use this flag to indicate if CNI prefix delegation has been enabled.
--cni-max-eni specify how many ENIs should be used for prefix delegation. Defaults to using all ENIs per instance.
--show-max-allowed Use this flag to show max number of Pods allowed to run in Worker Node. Otherwise the script will show the recommended value

and can be found at:

https://github.com/awslabs/amazon-eks-ami/blob/main/templates/al2/runtime/max-pods-calculator.sh
https://raw.githubusercontent.com/awslabs/amazon-eks-ami/main/templates/al2/runtime/max-pods-calculator.sh

example:

# /etc/eks/max-pods-calculator.sh --instance-type r7a.large --cni-version 1.18.1-eksbuild.3 --cni-prefix-delegation-enabled --show-max-allowed
434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data request Data provided by AWS that should be included.
Projects
None yet
Development

No branches or pull requests

3 participants