AWS EKS - Optimize EC2 node kernel #780
logo306142054
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It doesn't optimize EC2 node kernel by default when we create EKS cluster on the AWS by
eksctl
tool according official docs.To optimize the EC2 node kernel, we must set the EC2 startup script when creating EKS cluster. The K8S has been using containerd as the container runtime since version 1.25. The kernel parameters in POD are affected by the startup parameters of containterd. Therefore, we also need to modify the startup configuration of containerd at the same time.
Since there are many parameter configurations involved, we use configuration file instead of command line parameters. For specific usage, please refer to EKSCTL official documentation. A configuration file example is as follows:
Saving the above content as the file config.yaml and create EKS cluster using the following command:
For the created EKS cluster, the AWS will save the EC2 node startup script as a "launch template", which can be found in the EC2 console "Instances" -> "Launch Templates".
It should be noted that the
overrideBootstrapCommand
in the above configuration file is saved in the launch template in the form of "user data" and encoded using base64. When manually editing "user data", you needs to decode it first.The launch template has the concept of version management. After updating the launch template, the initial version is still used by default. We need to manually point the default version to the latest version. Only then can the latest launch template be automatically enabled when EKS node scaling. Another way is to enter the EKS control panel, go to the "Compute" tab of the cluster, and set the "Launch template" of the Node Group.
After updating the default version, you need to apply the latest launch template through EKS node scaling. The strategy is to first expand nodes, and then scale down nodes after the new nodes are created (to be verified). It is recommended that after manually updating the default version, use the second method to switch the Node Group's launch template. At this time, EKS will automatically roll update EC2 nodes without manual node scaling.
Beta Was this translation helpful? Give feedback.
All reactions