Kubernetes was originally developed by Google to power their Container Engine. As such, Kubernetes clusters are a first class citizen at Google.
Creating a Kubernetes cluster in the container engine requires gcloud
command from the Google Cloud SDK. To install this command locally, use one of the following options:
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init
download the SDK from https://cloud.google.com/sdk/ and run the appropriate install file.
For example, to install in Linux (x86_64):
curl -Lo gcloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-142.0.0-linux-x86_64.tar.gz
tar xvf ./gcloud-sdk.tar.gz
./google-cloud-sdk/install.sh
gcloud init
Once gcloud
is installed, create a Kubernetes cluster with:
# Give our cluster a name
CLUSTER_NAME=example-cluster
# Number of machines in the cluster.
NUM_NODES=3
gcloud container clusters create $CLUSTER_NAME --num_nodes=$NUM_VMS