-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat: Improve managed node group bootstrap revisited #1577
feat: Improve managed node group bootstrap revisited #1577
Conversation
How does this work with custom AMI without merging userdata and calling boostrap manually, are this labels still set on the launch template user data:
Which are the automatically merged bootstrap script when not using custom ami |
@ArchiFleKs this doesn't change the current behaviour, so I'm not quite sure what the question is? If an AMI is provided then we call |
@ArchiFleKs I think I see your point, let me make a change. |
@ArchiFleKs this looks like a defect in the current release for custom AMIs? I can see there is also a defect in my PR as |
Yes you are right the issue comes from another commit. I'm not sure it is a defect I have never used a custom AMI I'm just wondering if this label are also set when using custom AMI or if we loose them because of having to call the bootstrap command manually. |
@ArchiFleKs based on the code and AWS docs I suspect you would need to replicate the bootstrap args or set the env variables for a custom AMI to work as expected. |
@ArchiFleKs could you take a look at the changes to fix the behaviour when no |
@daroga0002 is this the type of generic you were looking for? The only pain point with a generic solution like this is that the default values will be overridden as a single value due to TF limitations. |
I think with the if statement It should be ok with standard AMI |
How would someone wanting to use |
@ArchiFleKs the following config would do this assuming that you wanted 110 pods per node. node_groups = {
my_group = {
bootstrap_env = {
CONTAINER_RUNTIME = "containerd"
USE_MAX_PODS = false
}
kubelet_extra_args = "--max-pods=110"
}
} |
@stevehipwell just to let you know I seeing your good job 🎉 and have your PRs on list to review (and test). I will try to find a time soon for this |
@daroga0002 would you like me to close #1433 so as to not confuse matters? I think this one is preferred by the maintainers? |
lets keep this open as I will took look on both |
Just tested this, working as expected, I think this PR is better than the old one because this allow to use pretty much any environments variable available in eks bootstrap script without having to do another PR here. True it is less obvious to the users but I think we can give example instead. |
I like it. Just need to make sure that it satisfies the needs for people using custom AMI, but for the rest, it looks good |
@jaimehrubiks I'd take #1580 first and then add these changes on top of that; so custom AMIs are supported correctly. |
Hey folks quick question, without this PR is there any other way to enable |
@FabioAntunes you can implement the code in this PR directly into your userdata to achieve the same behaviour, this is what I'm doing until the PR is merged. |
@daroga0002 @antonbabenko @ArchiFleKs this has been rebased to work with the changes in #1580. |
@daroga0002 this has been rebased on your data source fix, could we look at getting this in the next release? |
@daroga0002 I've rebased again with the MNG AMI fix. |
Thank you for the PR, I used it on my fork and I confirm it works as expected ! |
@daroga0002 how are you doing for availability? Could you take a look at this PR? |
@daroga0002 @antonbabenko it'd be good to get this merged as I'd like to open a PR on top of this for Bottlerocket now it's supported. https://aws.amazon.com/about-aws/whats-new/2021/10/amazon-eks-nodes-groups-bottlerocket/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevehipwell thank you for contribution 🎉
I have reviewed and tested this and works fine.
Diff between new and old approach in userdata:
13c13,15
< export ADDITIONAL_KUBELET_EXTRA_ARGS=""
---
> export CONTAINER_RUNTIME="containerd"
> export USE_MAX_PODS="false"
> export ADDITIONAL_KUBELET_EXTRA_ARGS="--max-pods=110"
32c34
+ node label on launch template which I omitted in diff.
@antonbabenko lets merge this to master |
Here we go! 🎉 v17.23.0 has been just released. |
Thank you @daroga0002 & @antonbabenko, I'll open a PR shortly to support Bottlerocket in MNGs. Is there any news on a refactored pattern for un-managed launch template nodes? |
I dont think so, in general there was quite good PR: Additional consideration is how to make it more consistent with node_groups submodule as some code probably can be shared (like launch template). |
@daroga0002 it might make more sense to add a new input and create a sibling module to the MNG to create non-MNGs without needing a breaking change. The launch template code could also then be extracted into a shared module, although that might want to wait until both are stable. |
maybe, but from other side it will be nightmare to maintain it. I think we need here finally release some major breaking change and fixing a lot of |
I'd propose doing this first and then doing the big breaking changes refactor to remove legacy issues and side effects. It might even line it up with the future Terraform auto state mapping (if the removal of count isn't already supported) so it's only a breaking change if you're using the legacy patterns and side effects. I'd be keen to be a part of this work. |
Hi, @ArchiFleKs is it possible to set
I really appreciate any suggestion here, |
Unsure I'm not using work_groups anymore, maybe @stevehipwell can give you a better answer but I don't think you can based on this |
@jurabek pre_userdata = <<-EOT
export CONTAINER_RUNTIME="containerd"
EOT |
@stevehipwell that worked for me, thank you very much. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
PR o'clock
Description
This PR could replace #1433.
The managed node group bootstrap pattern has been modified to set the
/etc/eks/bootstap.sh
environment variables to control the bootstrap process. To do this a newbootstrap_env
variable has been added which sets env variables to be sourced into/etc/eks/bootstrap.sh
from a new/etc/profile.d/eks-bootstrap.sh
file. For power userspre_userdata
can append additional values or dynamic functionality to this file.Checklist