-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to enable containerd
when using EKS managed node group
#844
Comments
For this specific case, yes; this is the best way to accomplish it. The upcoming 1.22 release will make such workarounds unnecessary, as |
Sorry, my info was outdated -- the change to |
@bryantbiggs @cartermckinnon I'm planning on opening a PR in this repo to update bootstrap.sh with a known file to source when present. This will be a no-op unless someone creates the file to set these variables (or other variables such as dynamic labels). |
This does not seem to work anymore. It only uses the args passed through the call to bootstrap.sh and the environment variable gets overwritten. Edit: To specify: My userdata only contains the preparatory work, the bootstrap.sh call is added by EKS internally. But EKS adds --kubelet-extra-args as flag and thus the environment variable is just overwritten and has no effect. Does anyone have a simple way to work around this or do I need to patch bootstrap.sh to get it working? |
@stevehipwell thank you. got it working with
It's not nice, but get's the job done |
That's what #855 is meant to make a lot cleaner by allowing the passing of env variables between cloud init steps. |
I know and that patch is already in place.
Unfortunately with terraform and EKS itself, it needs to merge both environment variables and command line arguments. I added stuff through the environment variables and EKS injects all the labels as command line flags on bootstrap.sh My sed only patches the line in the argument parser, so that in case both are specified, they get merged. If there are no flags set, the environment variable will be used. |
@lobeck if you look at terraform-aws-modules/terraform-aws-eks#1789, specifically the new linux_mng_merge_user_data.tpl file you'll see my updated version of how this should work; effectively you just need to set env variables to fully configure bootstrap. The code in the initial issue comes from the implementation I added to an earlier version of the |
Awesome, can't wait for this to get merged, so I can remove my crufty patches :D |
The `/etc/eks/bootstrap.sh` script accepts kubelet extra args as an argument, which overwrites the `KUBELET_EXTRA_ARGS` environment variable we define in our `pre_bootstrap_user_data`. Using `sed` we are able to change the behavior of the bootstrap script such that it accepts the extra args as both an argument and from the environment. Relevant links: - awslabs/amazon-eks-ami#844 - [Problem identified](awslabs/amazon-eks-ami#844 (comment)) - [Single line fix](awslabs/amazon-eks-ami#844 (comment)) - [Complete example](awslabs/amazon-eks-ami#844 (comment))
This should be tricked by adding the following line to the user data:
|
In the latest AWS AMI versions we need to make sure to overwrite kubelet invocation as it does not use its config file for checking max pods and instead rely on cli args to set the desired number of max pods. This is related to awslabs/amazon-eks-ami#844 and proper credits should be given to awslabs/amazon-eks-ami#844 (comment) (@lobeck). I am using this in production with clusters ranging from 1.21 to 1.23 without issues even on new AMI optimized releases.
In the latest AWS AMI versions we need to make sure to overwrite kubelet invocation as it does not use its config file for checking max pods and instead rely on cli args to set the desired number of max pods. This is related to awslabs/amazon-eks-ami#844 and proper credits should be given to awslabs/amazon-eks-ami#844 (comment) (@lobeck). I am using this in production with clusters ranging from 1.21 to 1.23 without issues even on new AMI optimized releases.
I know this may not be the best place to ask, but I wanted to give it a shot anyways.
Is there a way to simply just set environment variables when using EKS managed node groups (*WITHOUT specifying a custom AMI ID and therefore relying on the default user data bootstrap script provided by the EKS managed node group) and still enable
contianerd
?You can see more details here, but it looks like in order to get
containerd
we have to go into some bash fu in the user data that we/users provide that gets pre-pended to the user data that the EKS managed node group service provides in order to get this to work:I just wanted to see if it were possible to do the following instead do (at least, thats what the "API" looks like when viewing the
bootstrap.sh
script:thank you!
The text was updated successfully, but these errors were encountered: