google app engine

Google Cloud Platform Container Engine Tutorial(2)

Superkill 2017. 8. 18. 19:16
반응형

1. 애플리케이션 확장

다음 명령을 사용하여 애플리케이션을 복제본 4개로 확장합니다. 각 복제본은 클러스터에서 독립적으로 실행되고 부하 분산기가 제공하는 트래픽을 받습니다.


kubectl scale deployment hello-node --replicas=4


2. 애플리케이션 설정 보기

다음 명령으로 클러스터의 배포 설정을 확인합니다


kubectl get deployment

kubectl get pods


3. 애플리케이션 업데이트

편집기 또는 첫 번째 명령을 사용하여 다른 메시지를 반환하도록 server.js의 로컬 사본을 수정하고 Docker 이미지를 빌드합니다.

sed -i -e 's/!/ Version 2!/g' server.js


docker build -t gcr.io/프로젝트ID/hello-node:v2 $PWD


4. 애플리케이션 게시

Now that we have a new container image, we can publish it with a new tag:

gcloud docker -- push gcr.io/프로젝트ID/hello-node:v2



kubectl set image deployment/hello-node hello-node=gcr.io/프로젝트ID/hello-node:v2 
echo 'image updated'


5. 수정된 애플리케이션 보기

동일한 주소에서 애플리케이션의 새 버전을 확인합니다. 애플리케이션 이미지가 업데이트되는 데 1분 정도 걸릴 수 있습니다.

kubectl get service hello-node

http://EXTERNAL-IP:8080

'google app engine' 카테고리의 다른 글

gcloud command reference  (0) 2017.08.19
Google Container Engine(GKE)  (0) 2017.08.18
Google Cloude Platform Container Engine Tutorial(1)  (0) 2017.08.18
구글 클라우드 교육용  (0) 2017.07.13
Google App Engine  (0) 2017.07.13