Skip to content
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

fix(#195): UserData behaviour change between 2 and 3 breaks order of execution #198

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChrisMcKee
Copy link
Contributor

what

  • Split the bootstrap out of the userdata templates into separate files, add ${bootstrap_script} into files in its place
  • launch_template.tf Add precondition check; If after_cluster_joining_userdata is set but ami_image_id isn't and the OS is AL2/WINDOWS, show error
  • userdata.tf Add bootstrap_script to local.userdata_vars; load in the userdata_bootstrap* file for the OS if the OS is AL2/Windows, otherwise, use empty string.
  • variables.tf Add further detail to after_cluster_joining_userdata

why

Nodes that use custom userdata but don't use a custom-ami are creating a launch-template with the userdata in place but AWS is then injecting their bootstrapper at the end of the userscript. This means that after_cluster_joining_userdata will execute before cluster registration.

references

closes #195

@ChrisMcKee ChrisMcKee requested review from a team as code owners September 18, 2024 13:18
@mergify mergify bot added the triage Needs triage label Sep 18, 2024
Copy link

mergify bot commented Sep 19, 2024

💥 This pull request now has conflicts. Could you fix it @ChrisMcKee? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Sep 19, 2024
@ChrisMcKee ChrisMcKee closed this Sep 19, 2024
@mergify mergify bot removed conflict This PR has conflicts triage Needs triage labels Sep 19, 2024
…s in unexpected behaviour

Nodes that use custom `userdata` but don't use a custom-ami are creating a launch-template with the userdata in place
but AWS is then injecting their bootstrapper at the end of the userscript.
This means that `after_cluster_joining_userdata` will execute before cluster registration.

* Split the bootstrap out of the userdata templates into separate files, add ${bootstrap_script} into files in its place
* `launch_template.tf` Add precondition check; If `after_cluster_joining_userdata` is set but `ami_image_id` isn't and the OS is AL2/WINDOWS, show error
* `userdata.tf` Add `bootstrap_script` to local.userdata_vars; load in the userdata_bootstrap* file for the OS if the OS is AL2/Windows, otherwise, use empty string.
* `variables.tf` Add further detail to `after_cluster_joining_userdata`
@ChrisMcKee ChrisMcKee reopened this Sep 19, 2024
@mergify mergify bot added the triage Needs triage label Sep 19, 2024
@Nuru Nuru added do not merge Do not merge this PR, doing so would cause problems and removed triage Needs triage labels Sep 25, 2024
@Nuru
Copy link
Sponsor Contributor

Nuru commented Sep 25, 2024

Hopefully this PR will be rendered unnecessary by #200 and can be closed without merging. I would prefer not to mess with userdata unless necessary, because any change causes all the Nodes to be replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Do not merge this PR, doing so would cause problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows node not joining the eks cluster
2 participants