Giter VIP home page Giter VIP logo

deploy-webapp-with-techstack-terraform-aws--eks's Introduction

Deploying-and-Managing-a-Pac-Man-Game-on-AWS-EKS-using-Terraform

This repo is all about Deploying-and-Managing-a-Pac-Man-Game-on-AWS-EKS-using-Terraform.

Coding

Lets start the adventure!!

STEP 1 :

1.Deploy the EKS Cluster with Terraform.

2.git clone Github Repo(git clone [email protected]:bikrantsahoo/Deploy-webapp-with-techstack-terraform-aws--eks.git)

3.Change into the eks directory: cd eks

4.ls now & we should see the eks-cluster.tf, main.tf, outputs.tf, terraform.tf, variables.tf, and vpc.tf configuration files.

5.Initialize the working directory: terraform init

6.Validate the configuration: terraform validate

7.Now apply the configuration and deploy the EKS cluster: terraform apply -auto-approve

Note: It can take between 15 and 20 minutes to deploy the eks cluster. ezgif-5-c8763281f6 (1)

ezgif-5-0415763f68

STEP 2 :

Once aws eks cluster is deployed, configure the Kubernetes CLI to use the cluster’s context. aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) kubectl cluster-info (To confirm that the cluster is active) We should see that the Kubernetes control plane and CoreDNS are running as expected.

ezgif-5-a33a393b29

STEP 3 :

  1. Complete the Terraform Configuration by change into main directory
  2. cd ../pac-man/
  3. Docker Image used for this lab is “docker.io/jessehoch/pacman-nodejs-app:latest”
  4. terraform init
  5. terraform validate
  6. terraform apply -auto-approve

STEP 4 :

  1. Once deployed, confirm that the web application resources were deployed in the pac-man namespace and are available.
  2. kubectl -n pac-man get all
  3. We should see that the mongo and pac-man pods, services, deployments, and replicas are all available and running as expected.
  4. For the pac-man service, copy the DNS record provided in the EXTERNAL-IP column.
  5. In a new browser tab or window, paste the external IP address and hit Enter.
  6. When the Pac-Man web application launches.
  7. Click to play as instructed, and play the game to confirm that it is working as expected.

ezgif-5-36dfc56605

ezgif-5-f8ad4b3687-0000

STEP 5 :

  1. Scale the AWS EKS Pac-Man Application.
  2. Edit the MongoDB deployment configuration file:
  3. vi modules/mongo/mongo-deployment.tf
  4. For the replicas spec, update the replicas value to 2. save & exit.
  5. Edit the Pac-Man deployment configuration file:
  6. vi modules/pac-man/pac-man-deployment.tf
  7. For the replicas spec, update the replicas value to 3. save & exit.
  8. Apply the updates to the configuration : terraform apply
  9. When prompted, enter yes to confirm.
  10. Confirm that the resources were updated: kubectl -n pac-man get all
  11. We should see that the mongo and pac-man pods, deployments, and replicas have all been scaled up to 2 and 3, respectively.
  12. In the browser, refresh the Pac-Man web application and confirm that it is still working as expected.

STEP 6 :

  1. Edit the MongoDB and Pac-Man deployment configuration files again, this time changing the replicas back to 1.
  2. Apply the updates to the configuration : terraform apply
  3. Confirm that the resources were updated: kubectl -n pac-man get all
  4. We should see that the mongo and pac-man pods, deployments, and replicas have all been scaled back down to 1 each.
  5. In the browser, refresh the Pac-Man web application and confirm that it is still working as expected.

STEP 7 :

destory all the above proofs by terraform destroy.

Congrtulation for completing the prject involving aws eks/terraform and deploying this game pacman

deploy-webapp-with-techstack-terraform-aws--eks's People

Contributors

bikrantsahoo avatar kunal-shah107 avatar

Forkers

abhi-gaur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.