Creating a cluster on GKE to host the containers

The container engine cluster runs on top of GCE. For this recipe, we'll create a two-node cluster which will be internally managed by Kubernetes:

  1. We'll create the cluster using the following command:
$ gcloud container clusters create mysite-cluster --scopes "cloud-platform" --num-nodes 2 --zone us-east1-c

The gcloud command automatically generates a kubeconfig entry that enables us to use kubectl on the cluster:

  1. Using kubectl, verify that you have access to the created cluster:
$ kubectl get nodes

The gcloud command is used to manage resources on Google Cloud Project and kubectl is used ...

Get Google Cloud Platform Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.