Prep Lab 2.1: Provision a Kubernetes Cluster Using The AWS EKS Quick Start

Keyboard Time: 5 mins, Automation Wait Time: 60 mins

Scenarios: Instructor-Led, Self-Paced

What is an AWS Quick Start?

“Quick Starts are automated reference deployments built by Amazon Web Services (AWS) solutions architects and AWS Partners. Quick Starts help you deploy popular technologies on AWS according to AWS best practices. You can reduce hundreds of manual procedures to just a few steps so that you can build and start using your environment within minutes.”

Quote from: AWS Quick Starts

Since this Quick Start is for AWS technology and functions as a dependency of many other partner Quick Starts - it reflects AWS internal best practices for EKS deployment and has value over console or eksctl deployment methods. For these labs we take advantage of the single parameter inclusion of the Kubernetes Cluster Autoscaler and spot instances and especially the very valuable EKS Bastion for cluster administration.

Classroom Setup and Labs Assume EKS Quick Start
The exercises, as written, assume that the cluster was prepared with the EKS Quick Start. If you decide to use other methods, you will need to also provision a cluster administration workstation with helm, kubectl, kube configuration and AWS authentication to perform EKS administration commands as needed. Additionally, you will need to plan for Kubernetes node scaling that matches your class size. If you prepare the cluster by another means, be sure to run through all exercises with your cluster before considering it ready for a classroom. Scale testing with a group should also be performed if using alternative cluster node autoscaling.
Target Outcomes
IMPORTANT: Time Saving Automation
A new CloudFormation template can simplify your setup to one template run rather than three to automate both the EKS Cluster and Runner Fleet creation. You must skip ahead and do the steps in Prep Lab 2.2 for creating ‘classgroup’ and retrieving the Runner Registration Token from that group. Then running this template results in completion of Prep Lab 2.1 and 2.2. Prep Lab 2.3 will still need to be done. UltimateGitOpsEKSInfrastructure.cf.yml (Click for QuickLaunch in AWS)
  1. Create an EKS Cluster that is very cost optimized for training scenarios.

  2. Do so very quickly by leveraging AWS official Managed Infrastructure as Code known as “AWS Quick Starts”.

  3. Not a Target: Learning the detailed ins and outs of deploying and configuring EKS.

IMPORTANT: Time Saving Automation

A new CloudFormation template can simplify your setup to one template run rather than three to automate both the EKS Cluster and Runner Fleet creation. You must skip ahead and do the steps in Prep Lab 2.2 for creating ‘classgroup’ and retrieving the Runner Registration Token from that group. Then running this template results in completion of Prep Lab 2.1 and 2.2. Prep Lab 2.3 will still need to be done. UltimateGitOpsEKSInfrastructure.cf.yml (Click for QuickLaunch in AWS)

This is the preferred way to deploy AWS Event Engine accounts when cohosted by AWS. AWS Event Engine deployments can only be done in us-east-1.

Deploy Official AWS EKS QuickStart with Spot Nodes

Keyboard Time: 5 mins, Automation Wait Time: 60 mins

Scenarios: Instructor-Led, Self-Paced

Guides Through: AWS EKS on the AWS Cloud

IMPORTANT
In order to take advantage of spot support and specifying the Kubernetes version (required by GitLab integration), we must first deploy a small ‘Advanced Configuration’ template from the EKS Quick Start that is then read by the main EKS Quick Start template when deploying.
  1. Login to your target AWS account.

  2. The following links will set the parameters in the table for you. You may customize the parameters before submitting the template. IMPORTANT Cluster add-on settings for Hashicorp vault and others are not used unless these items are installed during the next template deployment - they can be ignored.

    CF GUI Name         CF Parameter Name Value           Notes
    Stack name N/A spot-t2-medium-paramset
    Config set name ConfigSetName spot-t2-medium-paramset
    Kubernetes version KubernetesVersion 1.21 GitLab integrated K8s clusters must use specific versions
    Instance type 2 NodeInstanceType2 t3.medium Instance type cannot match what is used for NodeInstanceType
    in the EKS Quick Start deployment (next template below) as that value
    is used for the first spot type when spot is configured and all NodeInstanceTypes in a spot configuration must be unique from each other.
    Instance type 3 NodeInstanceType3 t3.large Instance type cannot match what is used for NodeInstanceType in the EKS Quick Start deployment (next template below) as that value is used for the first spot type when spot is configured and all NodeInstanceTypes in a spot configuration must be unique from each other.
    Default EKS node group configuration: On-demand percentage OnDemandPercentage 0
    Bastion configuration: On-demand percentage OnDemandBastionPercentage 0 Sets bastion host to be spot.

    Important: EKS Advanced Configuration ‘Config sets’ can be used to configure multiple deployments of the EKS Quick Start.

  3. Verify the above values - including any name substitutions you have elected to make.

  4. At ‘the bottom of the page’, Click Create stack.

  5. Wait for the deployment to complete successfully.

    Warning
    IMPORTANT FOR Instructor-Led - setup 1 EKS node per 5 students. This can be easily adjusted later and these are spot instances.
  6. The following links will set the parameters in the table for you. You may customize the parameters before submitting the template.

    CF GUI Name CF Parameter Name Value
    Stack name N/A spot2az
    Availability Zones AvailabilityZones us-east-2b,us-east-2c (example)
    Allowed external access CIDR RemoteAccessCIDR disabled-onlyssmaccess
    Config set name ConfigSetName spot-t2-medium-v120-paramset Must match Config set name in above ‘Advanced Configuration Template’
    Number of Availability Zones NumberOfAZs 2
    Amazon EC2 configuration: On-demand percentage OnDemandBastionPercentage Ignored and overidden by ‘Advanced Configuration Template’
    EKS cluster name EKSClusterName spot2az
    Kubernetes Version KubernetesVersion Ignored and overidden by ‘Advanced Configuration Template’
    Instance type NodeInstanceType t2.medium
    Number of nodes NumberOfNodes 2
    Maximum number of nodes MaxNumberOfNodes 3 IMPORTANT Instructor-Led: Adjust for class size, about 1 node per 5 students.
    Node group type NodeGroupType Unmanaged
    Default EKS node group configuration: On-demand percentage OnDemandPercentage Ignored and overidden by ‘Advanced Configuration Template’
    Node instance family NodeInstanceFamily Standard Auto DevOps will not work on ARM clusters
    Cluster Autoscaler ClusterAutoScaler Enabled
  7. Verify the above values - including any name substitutions you have elected to make.

  8. At ‘the bottom of the page’ Check I acknowledge that AWS CloudFormation might create IAM resources with custom names.

  9. Check I acknowledge that AWS CloudFormation might require the following capability: CAPABILITY_AUTO_EXPAND

  10. Click Create stack.

Prep Lab 2.2 Can Be Done in Parallel
You can complete Prep Lab 2.2 while this CloudFormation is processing, but this CF must complete successfully before doing Prep Lab 2.3.
Accomplished Outcomes
  1. Create an EKS Cluster that is very cost optimized for training scenarios.
  2. Do so very quickly by leveraging AWS official Managed Infrastructure as Code known as “AWS Quick Starts”.