EKS Anywhere., breaking changes starting v0.11.0. Need to build your own ubuntu images
This article is part of the EKS Anywhere series EKS Anywhere, extending the Hybrid cloud momentum | by Ambar Hassani | Apr, 2022 | Medium
WHAT WILL WE ACHIEVE AT THE END OF THIS ARTICLE
We will build an ubuntu OVA that will be used in EKS Anywhere cluster nodes. Note, this OVA will not bear any custom packages. We will work on customizations in the next article.
BREAKING CHANGES
EKS Anywhere installations prior to v0.11.0 had a seamless process of distributing both Bottlerocket and ubuntu based OS images as a part of cluster deployment. That is no longer the case!
Starting v0.11.0, AWS has ceased to distribute ubuntu based OVA templates used for the EKS Anywhere cluster nodes. Instead, users have to now build their own ubuntu images via a prescribed process in the AWS EKS Anywhere documentation. The process documentation is still evolving, and users need to connect the dots to get the ubuntu image built.
This article creates proof-points the ubuntu OS template and tagging steps along with bringing additional level of automating the manual tasks of doing so.
How and where do we start?
A set of packages and parameters were already installed on the EKS Anywhere administrative machine via the Terraform deployment. These give a head-start to create the intended Kubernetes version (1.21, 1.22 or higher) ubuntu OS template for the EKS Anywhere cluster nodes.
Please note that the procedure for various Kubernetes versions remains the same except for using the right script name for other versions of Kubernetes.
All the builder scripts are named as per Kubernetes version and placed in the home directory of the image-builder user on the EKS Anywhere administrative machine
The below listed pre-requistes for the image-builder process are already deployed while the EKS Anywhere administrative machine was created using Terraform. This is mainly for information purposes only.
- Creation of the image-builder user with appropriate permissions
- Automated installation of govc and image-builder software packages along with the required parameters to communicate with vSphere.
- These parameters were automatically induced via Terraform by leveraging the values placed in variables.tf file
- The parameters that were automatically created include govc export statements in the image-builder user profile, and a file named vsphere-connection.json for the image-builder utility.
- Automatic placement of the Template builder scripts in $HOME of the image-builder user profile
Let’s begin: To create the required template and tag it as per AWS guidelines,
- SSH into the EKS Anywhere administrative machine as image-builder with password ubuntu
- Run the automation script located under $HOME directory which bears the intended kubernetes version.
- The shell scripts are named starting with ubuntu_node_template and already placed in the $HOME directory.
- Provide the vSphere data center name as per the specific environment
- Provide the template folder name as Templates
- Provide the template name as per the intended Kubernetes version, e.g., ubuntu-2004-kube-v1.21, ubuntu-2004-kube-v1.22 or ubuntu-2004-kube-v1.23 and likewise.
- Once the script finishes, one can verify if the templates are correctly tagged.
- Change the name of the template for which the tags need to be collected. An example is given below for a build created with the template named as ubuntu-2004-kube-v1.21
govc tags.attached.ls -r /$vsphere_datacenter/vm/Templates/ubuntu-2004-kube-v1.21Output of the above command highlights that the script has correctly tagged the template as per AWS requirement
os:ubuntu
eksdRelease:kubernetes-1-21-eks-18
The script will for approximately 30 minutes. At the end of the script execution, a virtual machine with the template name specified as input will be created under Templates folder in vSphere.
Check out the below video for the end-to-end snip of the image builder process. This was done for Kubernetes version 1.21 and hence you will see that the template name created is ubuntu-2004-kube-v1.21
Please note that I will keep updating the scripts library to support higher Kubernetes version.
cheers
Ambar@thecloudgarage
#iwork4dell