Start a Conversation

Unsolved

30 Posts

578

October 19th, 2022 00:00

EKS Anywhere, Building the Administrative machine

dellambarhassani_0-1666161024183.png

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

EKS Anywhere Administrative machine is a term used to reference a virtual machine that allows conducting all EKS Anywhere related tasks via a combination of eksctl and kubectl command line. This is the first virtual machine that one has to setup using a combination of various toolsets mainly Docker and EKS Anywhere packages.

Administrative machine specifications: 4 vCPU, 8GB RAM, 100GB Storage (minimum recommended is 30, however 100 is preferred), ubuntu 20.04 Operating System, Access to Internet (direct or proxied) for downloading release bundles and packages. In my experience, the cluster builds and other processes are quicker with the above specifications.

The process is fairly simple; however, we will detail out every step to ensure consistent deployments and for individuals who like exact steps

Step-1 Prepare the base ubuntu template

Logon to the vSphere web client and create a folder named “Templates” if it does not exist already. Please ensure the folder name is Templates as in case sensitive. This folder is also going to be used EKS Anywhere to store the OVA templates and the name is hard corded in the automation scripts of EKS Anywhere.

Create a bare bones ubuntu 20.04 desktop virtual machine in the Templates folder. Since we will also double-up the EKS-Administrative machine for installing additional use-case centric software (keycloak, gitlab, etc.), it is best to keep it at 4 vCPU, 16GB RAM, 100GB disk. Refer to the below video to create the template.

Login to the vsphere web console once the ubuntu 2004 desktop virtual machine is created. Right-click on the newly created virtual machine, power it off and convert it into a template. In my case, I have named it as ubuntu-2004-desktop

So now the base template named is ready ubuntu-20–04-desktop in the Templates folder from which we can start creating the EKS Anywhere Administrative machine and installing various tools and packages.

Step-2 Create the EKS Anywhere Administrative machine from the base ubuntu template

A typical manual method would include using the vSphere web console to create a new machine from the above template, SSH into it and install various packages. However, in this case, we will use Terraform to showcase Infrastructure-as-a-code to create the intended virtual machine and deploy various software packages.

The below video overviews the steps required to create the EKS Anywhere administrative machine

Steps to be followed

  • Clone or download the git repository https://github.com/thecloudgarage/eks-anywhere.git to any machine that has Terraform installed and bears connectivity to vSphere endpoint
  • Navigate to eksa-admin-machine/terraform sub-directory
  • Edit the variables.tf file to adjust the variables as per specific environment
  • Apply the terraform configurations to create the EKS Anywhere administrative machine

The variables.tf file can be observed below

 

variable "vsphere_user" {
  description = "vSphere username"
  type        = string
  default     = "ambar@vsphere.local"
}
variable "vsphere_password" {
  description = "vSphere password"
  type        = string
  sensitive   = true
  default     = "Vsphere@1234"
}
variable "vsphere_server" {
  description = "vSphere server ip or fqdn"
  type        = string
  default     = "vc.iac.ssc"
}
variable "vsphere_datacenter" {
  description = "vSphere datacenter name"
  type        = string
  default     = "IAC-SSC"
}
variable "vsphere_compute_cluster" {
  description = "vSphere Cluster name"
  type        = string
  default     = "IAC"
}
variable "vsphere_resource_pool" {
  description = "vSphere existing resource pool to be used for this virtual machine"
  type        = string
  default     = "Test"
}
variable "vsphere_datastore" {
  description = "vSphere datastore name"
  type        = string
  default     = "CommonDS"
}
variable "vsphere_network" {
    description = "vSphere network to be used for the virtual machine"
    type        = string
    default     = "iac_pg"
}
variable "vsphere_templates_folder" {
  description = "vSphere templates folder for all base templates"
  type        = string
  default     = "Templates"
}
variable "existing_virtual_machine_template_name" {
    description = "Template name to be used for this virtual machine. Must be an existing template located in Templates folder"
    type        = string
    default     = "ubuntu-2004-desktop"
}
variable "virtual_machine_folder_name" {
    description = "Existing Folder name where the virtual machine will be configured"
    type        = string
    default     = "eks-anywhere"
}
variable "virtual_machine_name" {
  description = "Name of the virtual machine"
  type = string
  default = "eksa-admin-machine"
}
variable "virtual_machine_vcpu_count" {
  description = "virtual machine vCPU count"
  type        = number
  default     = 4
}
variable "virtual_machine_memory" {
  description = "virtual machine Memory"
  type        = number
  default     = 16384
}
variable "virtual_machine_disk0_size" {
  description = "virtual machine disk0 size"
  type = number
  default = 100
}
variable "virtual_machine_root_password" {
  description = "virtual machine password"
  type        = string
  sensitive   = true
  default     = "ubuntu"
}
variable "virtual_machine_static_ip_address" {
    description = "Static IP address to be used for the virtual machine"
    type        = string
    default     = "172.24.165.50"
}
variable "virtual_machine_subnet_mask" {
    description = "virtual machine subnet mask"
    type        = number
    default     = 22
}
variable "dns_servers" {
  description = "List of comma separated DNS server values"
  type        = list
  default     = ["172.24.164.10"]
}
variable "virtual_machine_domain_name" {
    description = "Domain name to be associated with the virtual machine"
    type        = string
    default     = "iac.ssc"
}
variable "ipv4_gateway" {
  description = "IPv4 gateway for the virtual machine"
  type        = string
  default     = "172.24.164.1"
}

 

Note:

  • Keep the OS base template in the variables.tf as ubuntu-2004-desktop 
  • Do not change the ubuntu username and password of the EKS Anywhere administrative machine
  • Do not change the bootstrapping scripts or paths within the cloned git repository

The structure of the main.tf file that is used to create the EKS Anywhere administrative machine is observed below

dellambarhassani_0-1666240729789.png

The above visual can be observed in the actual terraform code and the sequence of creating the EKS Anywhere administrative machine with respective software configurations can be well understood.

Execute the terraform commands to start the procedure once the variables.tf has been edited for the specific environment, 

 

 

terraform init
terraform plan
terraform apply

 

Once the terraform installation is complete, SSH into the static IP defined for the EKS Anywhere admin machine. Issue the below commands to verify successful installation of the key software packages

 

docker -v
Docker version 20.10.18, build b40c2f6

brew -v
Homebrew 3.6.2

eksctl anywhere version
v0.11.3

 

What gets installed on the EKS Anywhere administrative machine

  • Docker and Docker-compose
  • Homebrew
  • EKS Anywhere - version installed in my case is 0.11.3
  • EKS Anywhere installation includes eksctl cli and kubectl cli by default.
  • Terraform installation will also bootstrap additional packages like helm3, jq, yq, argocd cli, flux cli, which are helpful for various exercises.
  • Also, a user named "image-builder" with sudo access is created with the password of ubuntu to facilitate creation custom ubuntu OVAs that will be running in the EKS Anywhere cluster nodes. More on this in the next section.

If one is seriously interested in greater detail of what’s installed inside of EKS Anywhere build-tooling, then one can visit the GitHub page aws/eks-anywhere: Run Amazon EKS on your own infrastructure (github.com). The above GitHub project provides the list of open-source projects and the entire build tooling used by EKS Anywhere.

That’s it, the EKS Administrative machine is installed, and we can use it to create EKS Anywhere clusters.

cheers,

Ambar Hassani

#iwork4dell

No Responses!

Top