AL2023 UserData Available Documentation
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"
-
overrideBootstrapCommandinterface 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.
...
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
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
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
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.
This issue was closed because it has been stalled for 5 days with no activity.
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