Google Cloud

Build a Website on Google Cloud Challenge Lab Solution

Hello Friends in this article i am gone to share Build a Website on Google Cloud Challenge Lab Solution with you..


Also visit:  Create and Manage Cloud Resources Challenge Lab Solution


 

Build a Website on Google Cloud Challenge Lab Solution

Main Task

Task 1) Download the monolith code and build your container
Task 2) Create a kubernetes cluster and deploy the application
Task 3) Create a containerized version of orders and product 1. Microservices
Task 4) Deploy the new microservices
Task 5) Create a containerized version of the Frontend 1. microservice
Task 6) Deploy the Frontend microservice

Follow My Steps to get 100 out of 100 score in this Qwiklabs.

Follow Now

First Activate Cloud Shell

 

Build a Website on Google Cloud Challenge Lab Solution

Note: Run all the Given instruction in google cloud shell one by one

Task 1)  Download the monolith code and build your container.

Step 1) Use this link to Clone Project from GitHub Run all Commands on Google Cloud Shell.

git clone https://github.com/googlecodelabs/monolith-to-microservices.git

cd ~/monolith-to-microservices

./setup.sh

 

Step 2) Copy this Commands and Run in Google Cloud Shell

cd ~/monolith-to-microservices/monolith

npm start

Step 3) Copy this Commands and Run in Google Cloud Shell

gcloud services enable cloudbuild.googleapis.com

gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/fancytest:1.0.0 .


Task 2) Create a kubernetes cluster and deploy the application.

Step 1) Copy this Commands and Run in Google Cloud Shell

gcloud config set compute/zone us-central1-a

gcloud services enable container.googleapis.com

gcloud container clusters create fancy-cluster --num-nodes 3

 

Step 2) Copy this Commands and Run in Google Cloud Shell

kubectl create deployment fancytest --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/fancytest:1.0.0

 

Step 3) Copy this Commands and Run in Google Cloud Shell

kubectl expose deployment fancytest --type=LoadBalancer --port 80 --target-port 8080

 

Task 3)  Create a containerized version of your Microservices.

Step 1) Copy this Commands and Run in Google Cloud Shell

cd ~/monolith-to-microservices/microservices/src/orders

gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/orders:1.0.0 .

 

Step 2) Copy this Commands and Run in Google Cloud Shell

cd ~/monolith-to-microservices/microservices/src/products

gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/products:1.0.0 .

 

Task 4)  Deploy the new microservices

Step 1) Copy this Commands and Run in Google Cloud Shell

kubectl create deployment orders --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/orders:1.0.0

kubectl expose deployment orders --type=LoadBalancer --port 80 --target-port 8081

 

Step 2) Copy this Commands and Run in Google Cloud Shell

kubectl create deployment products --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/products:1.0.0

kubectl expose deployment products --type=LoadBalancer --port 80 --target-port 8082

 

Task 5) Configure the Frontend microservice.

Step 1) Copy this Commands and Run in Google Cloud Shell

cd ~/monolith-to-microservices/react-app

nano .env

 

Task 6)  Create a containerized version of the Frontend microservice.

Step 1) Copy this Commands and Run in Google Cloud Shell

cd ~/monolith-to-microservices/microservices/src/frontend

gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/frontend:1.0.0 .

 

Task 7)  Deploy the Frontend microservice.

Step 1) Copy this Commands and Run in Google Cloud Shell

kubectl create deployment frontend --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/frontend:1.0.0

kubectl expose deployment frontend --type=LoadBalancer --port 80 --target-port 8080

 

Once Query Execution is complete go back to qwiklabs page & Click on

  • Check My Progress Button try 2 or more times…
  • Once you get 100 points on this lab, now you can Click Button to End this lab.
    Now You Successfully Clear this Qwiklabs.

Enjoy….