Installing Stackdriver support

GKE now includes managed support for Stackdriver. Installing or updating Stackdriver support happens automatically when you select a GKE version for your cluster. This page describes how to:

  • Install or update to the default Legacy Stackdriver support.
  • Install or update to the newer Beta release of Stackdriver Kubernetes Monitoring.
  • Remove all Stackdriver support from a cluster.

The alternative releases of Stackdriver support are described in more detail in Overview of Stackdriver support.

Installing Stackdriver support lets you monitor your running GKE clusters, manage your system and debug logs, and analyze your system's performance using advanced profiling and tracing capabilities. A single installation procedure gives you access to the full Stackdriver suite of applications, including Stackdriver Monitoring, Stackdriver Logging, Stackdriver Error Reporting, and Stackdriver APM.

Before you begin

  • You must be an Owner of the project containing your cluster. Your project must be associated with a Workspace.

  • Your cluster must use GKE version 1.10.6 or 1.11.2 (or later, if available). All the current, approved GKE versions exceed this minimum.

Creating a new cluster

When you create a new GKE cluster, you get the Legacy Stackdriver support by default. Alternatively, you can select the newer Stackdriver Kubernetes Monitoring support, or remove all Stackdriver support.

The instructions in this section cover only the options relevant to Stackdriver. For complete instructions, see Creating a cluster.

CONSOLE

  1. Go to the GKE Kubernetes Clusters page for your project. The following button takes you there:

    Visit the GKE Clusters page

  2. Select Create Cluster at the top of the page.

  3. In the dialog, specify the following fields in addition to any other properties you want in your cluster. For more information, see Creating a Cluster.

    1. Master version: Choose version 1.10.6 or 1.11.2 (or later, if available).

    2. In the Advanced options section under Additional features, are three options for choosing Stackdriver support in your new cluster.

      For Legacy Stackdriver support in your new cluster, ensure these two options are selected:

      Legacy support

      For Stackdriver Kubernetes Monitoring support, additionally check the box Try the new Stackdriver beta Monitoring and Logging experience:

      Beta release opt-in

  4. Click Create to create the cluster.

GCLOUD

Use gcloud to create your cluster:

  1. Open a terminal window with Cloud SDK and gcloud installed. One way to do this is to use Cloud Shell:

    1. Go to the Kubernetes Clusters page for your project:

      GO TO KUBERNETES CLUSTERS

    2. Click the Activate Cloud Shell icon at the top of the page.

  2. Create your cluster as usual. You get Legacy Stackdriver support by default. For example, a simple creation with default options might look like the following:

    gcloud container clusters create [CLUSTER_NAME] \
      --zone=[ZONE] \
      --project=[PROJECT_ID] \
      --cluster-version=1.10
    
  3. Alternatively, to select Stackdriver Kubernetes Monitoring support for your new cluster, add the --enable-stackdriver-kubernetes option:

    gcloud beta container clusters create [CLUSTER_NAME] \
      --zone=[ZONE] \
      --project=[PROJECT_ID] \
      --cluster-version=1.10 \
      --enable-stackdriver-kubernetes
    

Updating an existing cluster

The following instructions explain how to do the following:

  • Update a cluster from no Stackdriver support to Legacy Stackdriver.
  • Update a cluster from no Stackdriver support to Stackdriver Kubernetes Monitoring.
  • Update a cluster from Legacy Stackdriver to Stackdriver Kubernetes Monitoring. You might also have to change your Stackdriver configurations. See Migrating to Stackdriver Kubernetes Monitoring.
  • Remove Stackdriver support from your cluster.

Which Stackdriver support does my cluster use?

Here is how you can tell what kind of Stackdriver support you have in your cluster:

  1. Click your cluster's name in the GKE console:

    GO TO KUBERNETES CLUSTERS

  2. In the Details panel for your cluster, see the Stackdriver Monitoring and Stackdriver Logging status, which has the following meaning:

    • Enabled: Your cluster is using Legacy Stackdriver support.
    • Enabled v2(beta): Your cluster is using the Beta version of Stackdriver Kubernetes Monitoring.
    • Disabled: Your cluster has no Stackdriver support.

Changing your Stackdriver support

To change the Stackdriver support for an existing cluster, follow the instructions below:

CONSOLE

  1. Go to the GKE Kubernetes Clusters page for your project. The following button takes you there:

    Visit the GKE Clusters page

  2. Upgrade your cluster to Kubernetes version 1.10.6 or 1.11.2 (or later, if available). For instructions, see Upgrading Clusters. Allow the upgrade to complete.

  3. Click the Edit icon (edit) for your cluster:

    GKE edit cluster

  4. Scroll down to the Advanced options section under Additional features, are three options for choosing Stackdriver support in your new cluster.

    To change to Stackdriver Kubernetes Monitoring support, ensure that all three options are selected:

    Choose Stackdriver Kubernetes Monitoring support

    To change to Legacy Stackdriver support, ensure that only the first two options are selected. If the third option is selected, Try the new Stackdriver beta Monitoring and Logging experience, then you should deselect it:

    Legacy support

  5. Click Save at the bottom of the page.

GCLOUD

The following gcloud instructions cover upgrading your cluster's Stackdriver support using the gcloud container clusters update command. Notice that you use the update command, not the upgrade command, even though we sometimes refer to this process as "upgrading."

  1. Open a Cloud Shell window in the project containing your cluster.

  2. If you have not done so, set up default values for your cluster in Cloud SDK:

    gcloud config set project [PROJECT_ID]
    gcloud config set compute/zone [COMPUTE_ZONE]
    
  3. Update your cluster to the desired Kubernetes version and select the Stackdriver support you want in the cluster. All approved GKE versions support both Legacy Stackdriver and Stackdriver Kubernetes Monitoring.

    A minimal update command is shown below covering only the options needed for Stackdriver:

    gcloud container clusters update [CLUSTER_ID] \
      --zone=[ZONE]  --region=[REGION]  \
      --logging-service=[LOGGING_SERVICE] \
      --monitoring-service=[MONITORING_SERVICE]
      

    Use the following values for [LOGGING_SERVICE] and [MONITORING_SERVICE]:

    Type of support [LOGGING_SERVICE] [MONITORING_SERVICE]
    Legacy Stackdriver "logging.googleapis.com" "monitoring.googleapis.com"
    Stackdriver Kubernetes Monitoring "logging.googleapis.com/kubernetes"1 "monitoring.googleapis.com/kubernetes"1
    None "none" "none"

    Note: This option appears only in gcloud beta container clusters create.

Next steps

Was this page helpful? Let us know how we did:

Send feedback about...

Stackdriver Monitoring
Need help? Visit our support page.