How to create a kubernetes cluster on the Google Cloud Platform (GCP)?

Creating a Google cluster

To create a Google cluster you can either do so with the Google Cloud Console, gcloud or the Google Cloud Shell, be aware though that the smallest possible machine to host Jenkins X is the n1-standard-2 machine-type.

Furthermore, to be able to use jx storage features like log storage or backups, your cluster needs additional permissions, see GKE Storage Permissions.

Using the Google Cloud Console

You can create Kubernetes clusters in a few clicks on the Google Cloud Console.

First make sure you have created/selected a Project:

Now you can click the create cluster button on the kubernetes clusters page or try create cluster.

Using the JX command line

If you have the JX command line setup locally, you can run jx create cluster gke --skip-installation to create a GKE cluster from there with defaults.

Using gcloud

The CLI tool for working with google cloud is called gcloud. If you have not done so already please install gcloud.

To create a cluster with gcloud follow these instructions.

Using Google Cloud Shell

To avoid having to install gcloud you can use the Google Cloud Shell as it already comes with most of the things you may need to install (git, gcloud, kubectl etc).

First you need to open the Google Cloud Shell via the button in the toolbar:

You can then create a cluster with gcloud by following these instructions.

Connecting to your cluster

Once you have created a cluster, you need to connect to it so you can access it via the kubectl or jx command line tools.

To do this click on the Connect button on the Kubernetes Engine page in the Google Console.

You should now be able to use the kubectl and jx CLI tools on your laptop to talk to the GKE cluster. e.g. this command should list the nodes in your cluster:

kubectl get node

Last modified January 25, 2020: release 0.0.1435 (7fe38ca)