EKS: Bootstrap container for calculating K8s max-pods value for different CNI configurations in a self-managed nodegroup #1692
etungsten
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
This seems to still work. However I will note that setting Additionally in the example userdata, it should be |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally Bottlerocket hosts determined the Kubernetes max pods value by mapping the host’s instance type to the number of ENIs available. We did this by checking EKS’s eni-max-pods file during boot up.
However, the maximum number of pods supported by an EC2 node now depends on several factors in addition to the number of ENIs an instance type has. These new factors cannot be determined by the Bottlerocket host at runtime:
EKS provides a helper script for users to manually calculate the number of maximum pods their nodes support before launching said nodes. Below we demonstrate how we can set up a Bottlerocket bootstrap container for calculating and configuring this max-pods value in a slightly more automated fashion.
Here is the Dockerfile for the example bootstrap container image:
The
bootstrap-script
script wraps around the max-pods-calculator script and is structured like so:The script depends on several environment variables to calculate the max-pods value. They will need to be set via the bootstrap-containers user-data.
Now we can add the settings for the bootstrap container in Bottlerocket’s instance user data:
Any Bottlerocket hosts launched with the instance user-data above should automatically configure
settings.kubernetes.max-pods
value according to the CNI configuration values you’ve set in the bootstrap container’s userdata.Beta Was this translation helpful? Give feedback.
All reactions