Launching An EKS Cluster
Launching An EKS Cluster
Introduction
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: https://github.com/sathish2java/Course_EKS-Basics
Solution
Log in to the live AWS environment using the credentials provided. Make sure you're
in the N. Virginia (us-east-1) region throughout the lab.
Create an IAM User with Admin Permissions
aws --version
unzip awscliv2.zip
which aws
It should be /usr/bin/aws.
19. Update it:
aws --version
aws configure
22. For AWS Access Key ID, paste in the access key ID you copied earlier.
23. For AWS Secret Access Key, paste in the secret access key you copied earlier.
24. For Default region name, enter us-east-1.
25. For Default output format, enter json.
26. Download kubectl:
eksctl version
eksctl help
It will take 10–15 minutes since it's provisioning the control plane and worker nodes,
attaching the worker nodes to the control plane, and creating the VPC, security group,
and Auto Scaling group.
2. In the AWS Management Console, navigate to CloudFormation and take a look at what’s
going on there.
3. Select the eksctl-dev-cluster stack (this is our control plane).
4. Click Events, so you can see all the resources that are being created.
5. We should then see another new stack being created — this one is our node group.
6. Once both stacks are complete, navigate to Elastic Kubernetes Service > Clusters.
7. Click the listed cluster.
8. Click the Compute tab, and then click the listed node group. There, we'll see the
Kubernetes version, instance type, status, etc.
9. Click dev in the breadcrumb navigation link at the top of the screen.
10. Click the Networking tab, where we'll see the VPC, subnets, etc.
11. Click the Logging tab, where we'll see the control plane logging info.
• The control plane is abstracted — we can only interact with it using the
command line utilities or the console. It’s not an EC2 instance we can log into
and start running Linux commands on.
12. Navigate to EC2 > Instances, where you should see the instances have been launched.
13. Close out of the existing CLI window, if you still have it open.
14. Select the original t2.micro instance, and click Connect at the top of the window.
15. In the Connect to your instance dialog, select EC2 Instance Connect (browser-based
SSH connection).
16. Click Connect.
17. In the CLI, check the cluster:
3. Change directory:
cd Course_EKS-Basics
cat nginx-deployment.yaml
cat nginx-svc.yaml
Copy the external IP of the load balancer, and paste it into a text file, as we'll need it in a
minute.
3. Create the deployment:
kubectl get rs
curl "<LOAD_BALANCER_EXTERNAL_IP>"
The output should be the HTML for a default Nginx web page.
9. In a new browser tab, navigate to the same IP, where we should then see the same
Nginx web page.
curl "<LOAD_BALANCER_EXTERNAL_IP>"
We should see the Nginx web page HTML again. (If you don't, wait a few more minutes.)
13. In a new browser tab, navigate to the same IP, where we should again see the Nginx
web page.
14. In the CLI, delete everything:
Conclusion
Congratulations on successfully completing this hands-on lab!