王水
Create and Manage Cloud Resources: Challenge Lab参考答案
2022-3-9 12:05
阅读:2707

Create and Manage Cloud Resources: Challenge Lab

https://www.cloudskillsboost.google/focuses/10258?parent=catalog


gcloud compute instances create xxx \

  --image-family debian-10 \

  --image-project debian-cloud \

  --machine-type f1-micro

  --zone us-east1-b


*******

gcloud container clusters create xxx-cluster --zone us-east1-b 

gcloud container clusters get-credentials xxx-cluster --zone us-east1-b


kubectl create deployment hello-server --image=gcr.io/google-samples/hello-app:2.0

kubectl expose deployment hello-server --type=LoadBalancer --port 8080


kubectl get service

----


gcloud compute instance-templates create n-template   --metadata-from-file startup-script=startup.sh

gcloud compute target-pools create n-pool  --region us-east1

gcloud compute instance-groups managed create n-group \

         --size 2          --template n-template          --target-pool n-pool --zone us-east1-b

gcloud compute firewall-rules create XXXXXX --allow tcp:80


gcloud compute health-checks create http http-basic-check     --port 80

gcloud compute backend-services create web-backend-service \

    --protocol=HTTP \

    --port-name=http \

    --health-checks=http-basic-check \

    --global


gcloud compute backend-services add-backend web-backend-service \

    --instance-group=n-group \

    --instance-group-zone=us-east1-b \

    --global


gcloud compute url-maps create web-map-http \

    --default-service web-backend-service

gcloud compute target-http-proxies create http-lb-proxy \

    --url-map web-map-http


gcloud compute addresses create lb-ipv4-1     --ip-version=IPV4     --global

gcloud compute forwarding-rules create http-content-rule \

    --address=lb-ipv4-1\

    --global \

    --target-http-proxy=http-lb-proxy \

    --ports=80


参考:

https://titangene.github.io/article/gcp-network-and-http-load-balancer.html


转载本文请联系原作者获取授权,同时请注明本文来自王水科学网博客。

链接地址:https://wap.sciencenet.cn/blog-461456-1328684.html?mobile=1

收藏

分享到:

下一篇
当前推荐数:0
推荐到博客首页
网友评论0 条评论
确定删除指定的回复吗?
确定删除本博文吗?