Google Cloud Quick Reference
  • Quick Reference for GCP Cloud Shell
  • Running Docker on Ubuntu 16.4
  • Google Kubernetes Engine - Quick Reference
Powered by GitBook
On this page

Google Kubernetes Engine - Quick Reference

This is a quick reference to Kubernetes on the Google Cloud Platform. these commands are more specific to administering kubernetes on GKE.

PreviousRunning Docker on Ubuntu 16.4

Last updated 6 years ago

Setting up your environment

If your using a local shell as in the Google Cloud SDK you can install the kubectl command-line tool with this command.

gcloud components install kubectl

remember this is a command reference for those who need access to commands fast and straight to the point, the links are provided to all documentation that goes in depth to these commands.

create a cluster

gcloud container clusters create [CLUSTER_NAME]

this command configures kubectl to use this specific cluster

gcloud container clusters get-credentials [CLUSTER_NAME]

We can use this command to set a default cluster for kubectl commands

gcloud config set container/cluster [CLUSTER_NAME]

you can use this command to resize the cluster. the -- size flag indicates the number of nodes to scale to, --node-pool is is the name of the node to resize.

gcloud container clusters resize [CLUSTER_NAME] --node-pool [POOL_NAME] \
 --size [SIZE]

Specifying a node image

  1. create a cluster with Container-Optimized image

gcloud container clusters create [CLUSTER_NAME]

2. create a cluster with Ubuntu as the node image

gcloud container clusters create [CLUSTER_NAME] --image-type ubuntu

Helpful Links going more in depth about the commands listed above.

If you are looking for a tutorial on running kubernetes locally, i highly recommend Kelsey Hightower's "Kubernetes the Hardway".
Deploying workloads to clusters
Resizing Clusters
Setting up logging with stackdriver
Managing Clusters
Cluster Networking