Skip to content

Instantly share code, notes, and snippets.

@lzcjames
Last active Apr 25, 2020
Embed
What would you like to do?
PCA Prep—Update and Scale Out a Containerized Application on a Kubernetes Cluster

export PROJECT_ID=YOUR-PROJECT-ID-HERE

I uploaded the src file via Cloud Shell

tar -xvzf echo-web-v2.tar.gz

docker build -t gcr.io/${PROJECT_ID}/echo-app:v2 .

docker push gcr.io/${PROJECT_ID}/echo-app:v2

Now you get 5 points

gcloud container clusters get-credentials echo-cluster --zone=us-central1-a

kubectl create deployment echo-web --image=gcr.io/${PROJECT_ID}/echo-app:v2

Now you get 10 points

kubectl scale deployment echo-web --replicas=2

Now you get 15 points

kubectl expose deployment echo-web --type=LoadBalancer --port 80 --target-port 8000

Go to the Kunbernette Engine -> Services & Ingress -> Click Load balancer's endpoint (e.g. 35.192.168.15:80)

Now you get 20 points

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment