This image is customized specifically for the EKS service and is not intended as a general OS image.
How to customize set up
Customization is done during first boot and is driven by the script
/var/lib/cloud/scripts/per-instance/00-EKS-config.sh. This is executed by cloud-init and output can be seen in
/var/lib/cloud-init-output.sh. The script will determine the cluster to join based on the instance tag
“Key=kubernetes.io/cluster/<cluster_name>, Value=owned" which should be associated with the instance from the autoscaling group. See the sample CloudFormation template in this same directory named amazon-eks-ubuntu-nodegroup.yaml.
Any user-data passed to the instance will run after the in-image configuration (
/var/lib/cloud/scripts/per-instance/00-EKS-config.sh). If you need to override the in-image configuration entirely you may use cloud-init’s runcmd to delete the in-image configuration and use cloud-init’s write_files to substitute your own configuration script in the same directory.
Here we have a customization example with complete replacement of the setup script. The ‘runcmd’ stanza would be omitted if the goal is to augment the existing setup rather than replace it entirely. The following would be added to the CloudFormation nodegroup template in the instance userdata property:
#cloud-config # Remove the built-in customization if you want/need to replace it completely runcmd: - [ cloud-init-per, once, rm, -f, /var/lib/cloud/scripts/per-instance/00-EKS-config.sh ] # Add your own customization write_files: - path: /var/lib/cloud/scripts/per-instance/01-EKS-custom.sh permissions: 755 owner: root:root content: | #!/bin/bash -eux ## Custom EKS setup likely using 00-EKS-config.sh as a guide