-
-
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
pre/post_bootstrap_user_data doesn't work anymore with AL2023 #3186
Comments
I can confirm this with module version 2.26, but also just from diving into the module code. The userdata for AL2023 completely ignores any values in the Instead, completely new variables with new expected syntax were introduced: Is the intent to stop supporting the userdata vars in this module? Or was it an oversight to leave out those variables from the AL2023 template file? |
Al2023 uses a different form of user data than AL2 - terraform-aws-eks/tests/user-data/main.tf Lines 108 to 210 in 97a08c8
|
@bryantbiggs Yes, and Windows also has a different form of user data than AL2, but they use the same module variables to build the templates. Are the concepts all that different between AL2 and AL2023? AL2023 seems to work the same way that AL2 works when specifying an AMI in the launch template. The only difference is an additional section for a I think this is just a matter of broken docs and expectations, not broken code. The logic for shimming a userdata script into a multipart MIME was already in this module, and it used the same userdata variables employed in other scenarios. So despite the fact that the new variables work well and allow flexibility in building a custom multipart MIME message, it is a bit unexpected to have new variables, especially given that the userdata readme still suggests using the older ones. I'm happy to make some readme update suggestions, though I'm not sure I quite understand the conditionals in the userdata module, and I've probably misunderstood something in the new AL2023 format anyway. If I've just misunderstood, then sorry. In any case, thanks for the time spent on this. |
An updated README would suit me fine, my current problem is I don't know how to get started |
I use settings blow:
al2023 shell script need to define #! |
Doesn't work for me, still can't find my script (grep'ing in the /var/lib don't yield anything)
Still the error
Wondering if the above is unrelated, and I'm simply not setting the cloudinit_post_nodeadm in the proper place ? As illustrated in the screenshot, I'm having it in |
please check lanch template's user data first and check does script had been add in the template. maybe you need to setup use_custom_launch_template = true. |
This is benign and not a module issue awslabs/amazon-eks-ami#1963 (comment) Also, you can't execute anything after the node bootstrap process when using EKS managed nodegroups - this is just the way EKS managed node groups work. When you supply user data to EKS MNG, it gets prepended to the user data that EKS MNG supplies - that means you can only run scripts *BEFORE the node bootstrap. We model that here by using See the docs here https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html#launch-template-user-data tl;dr - you need to first understand how EKS works and what changes are happening between each Kubernetes version supported in EKS. Once you understand that, you'll better understand how that is reflected here. |
I get your point. I wish I could apply your advice. But reality is, I'm just driving my EKS car, I'm not an EKS car mechanic, if you get the analogy. Best I can do is swapping summer/winter tires. If someday some almighty make the days 40 hours long instead of 24, then maybe I'll get there. Until then, thanks a lot to the community & you guys for answering my question 🙏🏿 Now, unless you want to keep the issue open to remind to add doc or whatever, we can close it |
Description
I switched my EKSes managed node group to AMI_TYPE AL2023_x86_64_STANDARD (from AL2_x86_64 previously). Then my user_data stopped working, I can see this
Unhandled unknown content-type
injournalctl -u cloud-init.service
And comparing with AL2 worker nodes, the part-001 & co script files are absent, aka the scripts/ folder is empty
Versions
Module version [Required]: 20.24.2
Terraform version: ```Terraform v1.6.6
on linux_amd64
Reproduction Code [Required]
Steps to reproduce the behavior:
No workspace
Local cache cleared
List steps : replace AMI_TYPE value by AL2023_x86_64_STANDARD
Expected behavior
My user data to be executed, hence the ops user created, so with this ~/.ssh/config
I can
Actual behavior
I have to open the AWS console, go to EC2 instance, connect via SSM, sudo, execute my user data, and only then I can SSH in as intended behavior.
Edit
Fixed TF snippet, tried with module latest 20.26.0, not better
The text was updated successfully, but these errors were encountered: