Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 820 Bytes

GSP305.md

File metadata and controls

36 lines (28 loc) · 820 Bytes

GSP305 Scale Out and Update a Containerized Application on a Kubernetes Cluster

gcloud container clusters get-credentials echo-cluster --zone=us-central1-a
kubectl create deployment echo-web --image=gcr.io/qwiklabs-resources/echo-app:v1
kubectl expose deployment echo-web --type=LoadBalancer --port 80 --target-port 8000

Build echo-web v2

gsutil cp gs://<PROJECT-ID>/echo-web-v2.tar.gz .
tar -xf echo-web-v2.tar.gz
docker build -t gcr.io/<PROJECT-ID>/echo-app:v2 .

Push the image to the Google Container Registry

docker push gcr.io/<PROJECT-ID>/echo-app:v2

Update image

kubectl set image deployment/echo-web echo-app=gcr.io/<PROJECT-ID>/echo-app:v2

scale

kubectl scale deployment echo-web --replicas=2