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

Can not provide user-data to EKS managed node group with AMI used is a derivative of the AWS EKS Optimized AMI #3285

Open
aenshin-pp opened this issue Jan 23, 2025 · 8 comments
Labels

Comments

@aenshin-pp
Copy link

Description

The documentation says that I can use pre_bootstrap_user_data but actually it is not used in template.

Image

Versions

  • Module version [Required]: 20.29.0

What is the proper way to pass user_data to EKS managed node group with AMI used is a derivative of the AWS EKS Optimized AMI in part of containerd config?

@bryantbiggs
Copy link
Member

We won't be able to assist without a reproduction as requested per the issue template

@aenshin-pp
Copy link
Author

@bryantbiggs here it is:

module "eks" {
  ...
  eks_managed_node_groups = {
    foo = {
      ...
      enable_bootstrap_user_data = true
      pre_bootstrap_user_data = "foo"

      min_size     = 2
      max_size     = 3
      desired_size = 2
      taints = {
        # This Taint aims to keep just EKS Addons and Karpenter running on this MNG
        # The pods that do not tolerate this taint should run on nodes created by Karpenter
        addons = {
          key    = "CriticalAddonsOnly"
          value  = "true"
          effect = "NO_SCHEDULE"
        },
      }
    }
  }

It is mostly taken from current module examples with adding the pre_bootstrap_user_data which has no effect despite doc mentioned it.

@bryantbiggs
Copy link
Member

thats not a full reproduction - you cannot simply run terraform init && terraform apply -auto-approve

@aenshin-pp
Copy link
Author

@bryantbiggs that is true. Let me show you easier example:

the template which is used to al2023 is here:
https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/templates/al2023_user_data.tpl

It doesn't render anything with name pre_bootstrap_user_data but documentation here:
https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/user_data.md#eks-managed-node-group

says it is.

I think it should be enough?

@bryantbiggs
Copy link
Member

pre_bootstrap_user_data is not used with AL2023 - AL2023 uses cloud-init with MIME multi-part file so that looks like this from the AL2023 example

pre_bootstrap_user_data is only applicable to AL2

@aenshin-pp
Copy link
Author

aenshin-pp commented Jan 23, 2025

pre_bootstrap_user_data is only applicable to AL2

then why doc says opposite?

The actual solution for AL2023 is to use cloudinit_pre_nodeadm as in example I guess?

Probably doc is not correct in that case.

@bryantbiggs
Copy link
Member

my apologies for not having every iota of information kept up to date and accurate on this project that is provided to you for free

@aenshin-pp
Copy link
Author

@bryantbiggs no problems. Just wanted to confirm and if it is so, it should be easy to fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants