Start a Conversation

Unsolved

30 Posts

12590

October 20th, 2022 09:00

EKS Anywhere, ubuntu OS images for cluster nodes

This article is part of the EKS Anywhere series EKS Anywhere., extending the Hybrid cloud momentum

What will we achieve by 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-requisites 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 package
  • Required parameters to communicate with vSphere included in variables.tf file
  • Export statements in the image-builder user profile
  • A file named vsphere-connection.json for the image-builder utility. 

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.21

Output 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

 

 

dellambarhassani_0-1666276872688.png

 

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 Hassani

#iwork4dell

 

2 Posts

February 21st, 2023 03:00

Hello Ambar,

This automation looks to be very helpful when building Ubuntu Nodes for EKSA

I am trying to follow this procedure however the below stage takes forever and eventually fails.

I am using 2004 Ubuntu Desktop.
Anything you think should have gone wrong? 

null_resource.virtual_machine_bootstrapper: Still creating... [41m24s elapsed]

│ Error: remote-exec provisioner error

│ with null_resource.virtual_machine_bootstrapper,
│ on main.tf line 105, in resource "null_resource" "virtual_machine_bootstrapper":
│ 105: provisioner "remote-exec" {

│ error executing "/tmp/terraform_2005445233.sh": wait: remote command exited without exit status or exit signal

Top