Kubernetes GCP commands


  • gcloud container clusters list
  • To configure kubectl for your cluster: gcloud container clusters get-credentials cluster-1.
  • Deploy and run an app: kubectl run hello-server --image gcr.io/google-samples/hello-app:1.0 --port 8080. To undo the run command: kubectl delete deployment hello-server.
  • Scaling your deployment: kubectl scale deployment --replicas=2 hello-server.
  • Create a service to make your app accessible to the world: kubectl expose deployment hello-server --type LoadBalancer --port 80 --target-port 8080.
  • To update an deployment with a new image version: kubectl set image deployment/hello-server hello-server=gcr.io/google-samples/hello-app:1.1.
  • To get the LB's external IP: kubectl get service hello-server.
  • To list all services running: kubectl get services.
  • Clean up: kubectl delete service hello-server and gcloud container clusters delete cluster-1.

Source: https://cloud.google.com/kubernetes-engine/docs/quickstart

Posted on Mon Aug 06 09:45:09 EDT 2018 by Subhash Chandran
cloud kubernetes gcp docker