From 639a0c0fd57a1d000dc9341ac5fa4a7c8b5a8970 Mon Sep 17 00:00:00 2001 From: DhruvChaurasia3418 <76548079+DhruvChaurasia3418@users.noreply.github.com> Date: Wed, 4 May 2022 21:18:50 +0530 Subject: [PATCH] Create Create and Manage Cloud Resources: Challenge Lab --- ... and Manage Cloud Resources: Challenge Lab | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 Create and Manage Cloud Resources: Challenge Lab diff --git a/Create and Manage Cloud Resources: Challenge Lab b/Create and Manage Cloud Resources: Challenge Lab new file mode 100644 index 0000000..9612b6d --- /dev/null +++ b/Create and Manage Cloud Resources: Challenge Lab @@ -0,0 +1,121 @@ +=========> Run these commands first + +gcloud auth list + +gcloud config list project + + +Task 2 + + +gcloud config set compute/zone us-east1-b + +--------------------------------------------------------------------------------------------------------------------------------------------------- +===========> here you have to write any name in place of [CLUSTER-NAME] + +gcloud container clusters create [CLUSTER-NAME] + +--------------------------------------------------------------------------------------------------------------------------------------------------- + +=========> use same cluster name in this command also + +gcloud container clusters get-credentials [CLUSTER-NAME] + +----------------------------------------------------------------------------------------------------------------------------------------------------- + +kubectl create deployment hello-server --image=gcr.io/google-samples/hello-app:2.0 +------------------------------------------------------------------------------------------------------------------------------------------------------ + +========> write the Port name provided in your lab at : + +kubectl expose deployment hello-server --type=LoadBalancer --port + +------------------------------------------------------------------------------------------------------------------------------------------------------- + +========> write the Port name provided in your lab at : + +kubectl expose deployment hello-server --type=LoadBalancer --port + + + +====================================================================================================================================================== +Task 3 + + +==============> run command given in lab first then use these cammands + +------------------------------------------------------------------------------------------------------------------------------------------ + + gcloud compute instance-templates create web-server-template \ + --metadata-from-file startup-script=startup.sh \ + --network nucleus-vpc \ + --machine-type g1-small \ + --region us-east1 + + +------------------------------------------------------------------------------------------------------------------------------------------------------- +gcloud compute instance-groups managed create web-server-group \ + --base-instance-name web-server \ + --size 2 \ + --template web-server-template \ + --region us-east1 + + + + + +--------------------------------------------------------------------------------------------------------------------------------------------------------- + ===============> write firewall name provided in your lab at : + + +gcloud compute firewall-rules create \ + --allow tcp:80 \ + --network nucleus-vpc +gcloud compute http-health-checks create http-basic-check +gcloud compute instance-groups managed \ + set-named-ports web-server-group \ + --named-ports http:80 \ + --region us-east1 + + +------------------------------------------------------------------------------------------------------------------------------------------------------------ + + + gcloud compute backend-services create web-server-backend \ + --protocol HTTP \ + --http-health-checks http-basic-check \ + --global +gcloud compute backend-services add-backend web-server-backend \ + --instance-group web-server-group \ + --instance-group-region us-east1 \ + --global + +------------------------------------------------------------------------------------------------------------------------------------------------------------ + + + gcloud compute url-maps create web-server-map \ + --default-service web-server-backend +gcloud compute target-http-proxies create http-lb-proxy \ + --url-map web-server-map + + +------------------------------------------------------------------------------------------------------------------------------------------------------- + + + gcloud compute forwarding-rules create permit-tcp-rule-261 \ + --global \ + --target-http-proxy http-lb-proxy \ + --ports 80 + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + +gcloud compute forwarding-rules list + + +-------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +END of Lab + + +