For this workshop, one will be provided for you.
Enable the Google Compute Engine and Google Container Engine APIs
In this section you will start your Google Cloud Shell and clone the lab code repository to it.
-
Create a new Google Cloud Platform project: https://console.developers.google.com/project
-
Click the Google Cloud Shell icon in the top-right and wait for your shell to open:
- When the shell is open, set your default compute zone:
$ gcloud config set compute/zone us-east1-d
- Clone the lab repository in your cloud shell, then
cd
into that dir:
$ git clone https://github.com/askcarter/continuous-deployment-on-kubernetes.git
Cloning into 'continuous-deployment-on-kubernetes'...
...
$ cd continuous-deployment-on-kubernetes
You'll use Google Container Engine to create and manage your Kubernetes cluster. Provision the cluster with gcloud
:
$ gcloud container clusters create jenkins-cd \
--num-nodes 3 \
--scopes "https://www.googleapis.com/auth/projecthosting,storage-rw"
Once that operation completes download the credentials for your cluster using the gcloud CLI:
$ gcloud container clusters get-credentials jenkins-cd
Fetching cluster endpoint and auth data.
kubeconfig entry generated for jenkins-cd.
Confirm that the cluster is running and kubectl
is working by listing pods:
$ kubectl get pods
You should see an empty response.