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.
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
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.
Deploying workloads to clusters
Last updated