eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

AL2023 UserData Available Documentation

Open abeowlu opened this issue 1 year ago • 4 comments

What help do you need?

There isnt a clear wording in documentation that: "users NEED to create a launch template if custom userData (script) is required for Amazon Linux 2023"

  • overrideBootstrapCommand interface is no longer available.
  • Not sure how this UserData in nodebootsrap al23 is used, but the configuration below also is not valid
managedNodeGroups:
  - name: custAMIGroup
    ami: ami-079fcd733303590b9
    amiFamily: AL23
    userData: |
      MIME-Version: 1.0 
      Content-Type: multipart/mixed; boundary="BOUNDARY"      
      
      --BOUNDARY 
      Content-Type: text/x-shellscript; charset="us-ascii"

      #!/bin/bash
      echo "exec custom script here"
      
      --BOUNDARY--

      Content-Type: application/node.eks.aws      
      --- 
      apiVersion: node.eks.aws/v1alpha1 
      kind: NodeConfig 
      spec:
        cluster:
          apiServerEndpoint:
          certificateAuthority:
          cidr:
          name:

      --BOUNDARY--
While AL2023 implements the Bootstrapper interface, the underlying userdata will be entirely different from other AMI families. Specifically, AL2023 introduces a new node initialization process nodeadm that uses a YAML configuration schema, dropping the use of /etc/eks/bootstrap.sh script. For self-managed nodes, and for EKS-managed nodes based on custom AMIs, eksctl will populate userdata in the fashion below:
...
Required custom cloud-init scripts are no longer merged into a bootstrap.sh execution, and custom launch templates need to be defined to execute custom scripts on node bootstrap.
...

abeowlu avatar May 06 '24 21:05 abeowlu

Hello AbeOwlu :wave: Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-5 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

github-actions[bot] avatar May 06 '24 21:05 github-actions[bot]

Perhaps at least preBootstrapCommands can be added to the scripts to generate the final node config? https://github.com/eksctl-io/eksctl/blob/main/pkg/nodebootstrap/al2023.go#L55

tanvp112 avatar May 26 '24 02:05 tanvp112

We are facing the same issue and in order for us to run custom commands at bootstrap, we can no longer utilize the preBootstrapCommands - nor did see any way of supplying it differently

AmitBenAmi avatar May 30 '24 19:05 AmitBenAmi

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 30 '24 01:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

I struggled with this same question for a bit, and ended up having to read the eksctl code to find the answer.

The eksctl tool generates the nodeadm yaml for us. See the createNodeConfig function in https://github.com/eksctl-io/eksctl/blob/main/pkg/nodebootstrap/al2023.go#L72

dmacbride avatar Sep 24 '24 18:09 dmacbride