老码农分享 http://blog.sciencenet.cn/u/seawan //敲键读书打酱油;

博文

Create and Manage Cloud Resources: Challenge Lab参考答案

已有 3185 次阅读 2022-3-9 12:05 |个人分类:程序片段|系统分类:教学心得

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://blog.sciencenet.cn/blog-461456-1328684.html

上一篇:[转载]心法治病案例:徐老太倒着上楼
收藏 IP: 170.203.65.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-23 07:28

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部