terraform-aws-modules / terraform-aws-eks

Terraform module to create Amazon Elastic Kubernetes (EKS) resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/eks/aws
Apache License 2.0
4.39k stars 4.04k forks source link

cloudinit_pre_nodeadm not being passed to _user_data module #2980

Closed KingLeak95 closed 6 months ago

KingLeak95 commented 6 months ago

Description

I believe by these lines that the variable is is not being passed for eks_managed_groups

If your request is for a new feature, please use the Feature request template.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

Reproduction Code [Required]

ami-tests = {
      platform = "al2023"

      min_size     = 1
      max_size     = 3
      desired_size = 1
      ami_id       = data.aws_ami.al2023_ami.id

      cloudinit_pre_nodeadm = [
        {
          content_type = "text/x-shellscript; charset=\"us-ascii\""
          content      = <<-EOT
            #!/bin/bash
            #!/bin/bash
        TOKEN=$(curl --request PUT "http://169.254.169.254/latest/api/token" --header "X-aws-ec2-metadata-token-ttl-seconds: 10")
ZONE=$(curl http://169.254.169.254/latest/meta-data/placement/region --header "X-aws-ec2-metadata-token: $TOKEN")
IP_BASED_NAME=$(curl http://169.254.169.254/latest/meta-data/hostname --header "X-aws-ec2-metadata-token: $TOKEN" | cut -f1 -d".")
hostnamectl set-hostname --static $IP_BASED_NAME.$ZONE.compute.internal
      EOT
        },
        {
          content_type = "application/node.eks.aws"
          content      = <<-EOT
            ---
            apiVersion: node.eks.aws/v1alpha
            kind: NodeConfig
            spec:
              kubelet:
                config:
                  shutdownGracePeriod: 30s
                  featureGates:
                    DisableKubeletCloudCredentialProviders: true

          EOT
        }
      ]
    }

Steps to reproduce the behavior:

Attempt to pass cloudinit_pre_nodeadm

Expected behavior

cloudinit_pre_nodeadm is prepended to user_data

Actual behavior

`cloudinit_pre_nodeadm is ignored and only the templated data is send

Terminal Output Screenshot(s)

Additional context

antonbabenko commented 6 months ago

This issue has been resolved in version 20.8.4 :tada:

github-actions[bot] commented 5 months ago

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.