Skip to content

Instantly share code, notes, and snippets.

@lzcjames
Last active April 25, 2020 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lzcjames/831c7acbb3fd62df42d972ac242de561 to your computer and use it in GitHub Desktop.
Save lzcjames/831c7acbb3fd62df42d972ac242de561 to your computer and use it in GitHub Desktop.
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