Working with Google Stackdriver
In Chapter 7, Building Kubernetes on GCP, we introduced GKE. It has an integrated logging mechanism, which is called Google Stackdriver. In this section, we will explore the integration between GKE and Stackdriver.
Getting ready
To use a Stackdriver, you just need a GCP account. If you have never used GCP, please go back and read Chapter 7, Building Kubernetes on GCP, to set up a GCP account and the gcloud
command-line interface.
To use Stackdriver on GKE, no action is needed, because GKE uses Stackdriver as a logging platform by default. But if you want to explicitly enable Stackdriver, specify --enable-cloud-logging
while launching your Kubernetes by using the gcloud
command, as follows:
$ gcloud container clusters create my-gke --cluster-version 1.9.4-gke.1 --enable-cloud-logging --network default --zone us-west1-b
If, for some reason, you have a GKE that doesn't enable Stackdriver, you can use the gcloud
command to enable it afterwards:
$ gcloud container clusters...