Launching your first Google Kubernetes Engine cluster
As the cluster will take a few minutes to deploy fully, let’s run the command to initiate the process and then discuss in more detail what happens while it launches.
Before we launch our cluster, we must ensure that the container.googleapis.com
service is enabled. To do this, run the following command:
$ gcloud services enable container.googleapis.com
We then need to install a plugin that will allow us to authenticate against the cluster using kubectl
; to do this, run the following:
$ gcloud components install gke-gcloud-auth-plugin
Once the service and plugin have been enabled, the command to launch a two-node cluster called myfirstgkecluster
, which will be hosted in a single zone in the Central US region, is as follows:
$ gcloud container clusters create myfirstgkecluster --num-nodes=2 --zone=us-central1-a
After about five minutes, you should see something that looks like the following output...