Elastic Kubernetes Service (EKS) is a fully managed Kubernetes service from AWS. In this lab, you will work with the AWS command line interface and console, using command line utilities like `eksctl` and `kubectl` to launch an EKS cluster, provision a Kubernetes deployment and pod running instances of `nginx`, and create a `LoadBalancer` service to expose your application over the internet.
Course files can be found here:
[Kubernetes Cheat Sheet](https://acloudguru.com/blog/engineering/kubernetes-cheat-sheet)
Note that us-east-1 can experience capacity issues in certain Availability Zones. Since the AZ numbering (lettering) system differs between AWS accounts we cannot exclude that AZ from the lab steps. If you *do* experience an *UnsupportedAvailabilityZoneException* error regarding capacity in a particular zone, you can add the –zone switch to eksctl create cluster and specify three AZs which do not include the under-capacity zone. For example, `eksctl create cluster –name dev –region us-east-1 –zones=us-east-1a,us-east-1b,us-east-1d –nodegroup-name standard-workers –node-type t3.medium –nodes 3 –nodes-min 1 –nodes-max 4 –managed`
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create an IAM User with Admin Permissions
- Create an IAM user with programmatic access and administrator-level privileges.
- Take note of the access key and secret access key of your user because we will use them in the next step.
- Launch an EC2 Instance and Configure the Command Line Tools
- Create an EC2 instance in
us-east-1
region. - If necessary, upgrade the AWS CLI on your EC2 instance to CLI
v.2x
or later. - Configure the AWS CLI using the credentials of the user you just created.
- Install
eksctl
on your EC2 instance. - Install
kubectl
on your EC2 instance.
- Create an EC2 instance in
- Provision an EKS Cluster
- Use
eksctl
to provision an EKS cluster with three worker nodes inus-east-1
. - Use t3.medium instance types to create your cluster.
- Use
- Create a Deployment on Your EKS Cluster
- Course files can be found here: https://github.com/ACloudGuru-Resources/Course_EKS-Basics
- Use
kubectl
to create aLoadBalancer
service. - Check the status of your
LoadBalancer
service usingkubectl
. - Use
kubectl
to create aDeployment
on your EKS cluster, using the standardnginx
image EKS has available in the default Docker Hub registry. - Check the status of your cluster, deployment, and pods using
kubectl
. - When the
Deployment
is up and running, check that you can access your application using the DNS name of theLoadBalancer
.
- Test the High Availability Features of Your EKS Cluster
- In the AWS Console, shut down all the worker nodes.
- Check the status of your cluster, deployment, and pods using
kubectl
. - After a few minutes, you should see EKS launching new instances to keep your service running.
- When the cluster is back to a steady state, check that your application is up and running.