728x90
반응형

Copyright Qwiklabs Inc. & Google Cloud Skills Boost



gcloud auth list

Task 1. Create a project jumphost instance
작업 1: 프로젝트 jumphost 인스턴스 만들기

gcloud compute instances create [your-instance-name] \
    --network nucleus-vpc \
    --zone us-east1-b  \
    --machine-type f1-micro  \
    --image-family debian-9  \
    --image-project debian-cloud \
    --scopes cloud-platform \
    --no-address




Task 2. Create a Kubernetes service cluster
작업 2: Kubernetes 서비스 클러스터 만들기

gcloud container clusters create nucleus-backend \
	--num-nodes 1 \
	--network nucleus-vpc \
	--region us-east1

gcloud container clusters get-credentials nucleus-backend \
    --region us-east1

kubectl create deployment hello-server \
    --image=gcr.io/google-samples/hello-app:2.0
	
kubectl expose deployment hello-server \
    --type=LoadBalancer \
    --port 8081




Task 3. Set up an HTTP load balancer
작업 3: HTTP 부하 분산기 설정하기

cat << EOF > startup.sh
#! /bin/bash
apt-get update
apt-get install -y nginx
service nginx start
sed -i -- 's/nginx/Google Cloud Platform - '"\$HOSTNAME"'/' /var/www/html/index.nginx-debian.html
EOF

* Create an instance template.
* 인스턴스 템플릿을 만듭니다.
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

* Create a managed instance group.
* 관리형 인스턴스 그룹을 만듭니다.
gcloud compute instance-groups managed create web-server-group \
	--base-instance-name web-server \
	--size 2 \
	--template web-server-template \
	--region us-east1

* Create a firewall rule named as **** to allow traffic (80/tcp).
* 트래픽(80/tcp)을 허용하며 이름이 **** 인 방화벽 규칙을 만듭니다.
gcloud compute firewall-rules create [your-firewall-rule-name] \
	--allow tcp:80 \
	--network nucleus-vpc

* 상태 점검을 만듭니다.
* Create a health check.
gcloud compute http-health-checks create http-basic-check

* Create a backend service, and attach the managed instance group with named port (http:80).
* 백엔드 서비스를 만들고 관리형 인스턴스 그룹과 이름을 지정한 포트(http:80)를 연결합니다.
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

* Create a URL map, and target the HTTP proxy to route requests to your URL map.
* URL 맵을 만들고 URL 맵에 요청을 라우팅할 대상 HTTP 프록시를 설정합니다.
gcloud compute url-maps create web-server-map \
	
gcloud compute target-http-proxies create http-lb-proxy \
	--url-map web-server-map

* Create a forwarding rule.
* 전달 규칙을 만듭니다.
gcloud compute forwarding-rules create http-content-rule \
	--global \
	--target-http-proxy http-lb-proxy \
	--ports 80

gcloud compute forwarding-rules list




* If you have progressed to the last query, check it after a certain amount of time has elapsed.
* 마지막 쿼리까지 다 진행하였으면, 일정 시간이 지난 후 체크를 진행합니다.

 

728x90
반응형

BELATED ARTICLES

more