- Lab
- A Cloud Guru
Deploy a Web Application in Kubernetes with Terraform
Hey there, Gurus! Welcome to this hands-on lab. In this lab, you will first provision an EKS cluster with Terraform. Then, you will deploy an HTML5 web-based Pac-Man game that you can play in your browser to your EKS cluster with Terraform. Sounds like fun!
Path Info
Table of Contents
-
Challenge
Deploy Your EKS Cluster with Terraform
- In the AWS Management Console, in the IAM service, create an access key for the AWS CLI called
Terraform_Access_Key
. - In the terminal, configure the AWS CLI to connect to your AWS instance.
- Download the EKS Terraform configuration.
- Unzip the EKS Terraform configuration zip file.
- Change into the
eks
directory and initialize your working directory. - Deploy your EKS cluster with Terraform. (Note: This can take between 10 and 15 minutes.)
- Configure the Kubernetes CLI to use your EKS cluster context.
- Confirm your cluster is up and running.
- In the AWS Management Console, in the IAM service, create an access key for the AWS CLI called
-
Challenge
Complete the Terraform Configuration
- Download the Pac-Man Terraform configuration.
- Unzip the Pac-Man Terraform configuration zip file.
- Change into the
pac-man
directory. - Add the provided Docker image to your Pac-Man deployment configuration.
- Update the main Terraform configuration file to include your two modules and pass the
pac-man
namespace to them. - Save your changes and initialize your
pac-man
working directory. - Validate your configuration.
-
Challenge
Deploy the Pac-Man Web Application with Terraform
- Apply the Terraform configuration and deploy the web application in the
pac-man
namespace. - Confirm that your resources were deployed and are available.
- In a browser, launch the application and test that it's working by playing some Pac-Man!
- Apply the Terraform configuration and deploy the web application in the
-
Challenge
Scale the Kubernetes Web Application
- Change the
replicas
in your deployment configurations to2
backend pods and3
frontend pods. - Apply the changes to the Pac-Man web application with Terraform.
- Confirm the changes were successfully applied.
- In the browser, refresh the application and test that it is still working as expected.
- Scale the application back down to
1
backend pod and1
frontend pod. - Confirm the changes were successfully applied.
- In the browser, refresh the application again and test that it is still working as expected.
- Change the
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.