Enabling monitoring in GKE Platform
Contents
Learn how to enable monitoring in GKE Platform for the cluster and your private edition services.
Setting up monitoring for your private edition services in GKE Platform
This section describes how to use Cloud Monitoring to monitor your Google Kubernetes Engine (GKE) clusters. It also describes how to enable and authorize use of the Monitoring API
Google Cloud operations suite - Cloud Monitoring
Google Cloud's operations suite (formerly Stackdriver) enables a centralized capability of receiving events, logs, metrics, and traces from your GKE platform resources.
Cloud Monitoring tracks metrics, events, and metadata from GKE platform, uptime probes, and services. Stackdriver ingests that data and makes it available via dashboards, charts, and alerts.
For more details, refer to https://cloud.google.com/monitoring/docs.
Enable cloud monitoring
Supported values for the --logging
flag for the create and update commands.
Source | Value | Logs collected |
---|---|---|
System | SYSTEM | Metrics from essential system components required for Kubernetes functionality. See a complete list of these Kubernetes metrics. |
Workload | WORKLOAD | Enable a fully managed pipeline capable of collecting Prometheus-style metrics exposed by any GKE workload. You must configure which metrics to collect by deploying a PodMonitor custom resource. |
Console UI
To enable cloud monitoring through console UI, follow these steps:
- Navigate to Console UI.
- Select Clusters and then select the cluster instance.
- Under Features > Cloud Monitoring, click the Edit icon.
- Select Enable Cloud Monitoring and then select System and Workflow from the drop-down list.
- Click SAVE CHANGES.
This section explains setting up Prometheus on a Kubernetes cluster for monitoring the Kubernetes cluster.
GCloud CLI
To enable cloud monitoring through GCloud UI, follow these steps:
- Log on to the existing cluster.
gcloud container clusters get-credentials <cluster instance> --zone <zone name> --project <project name>
- Configure the logs to be sent to Cloud Monitoring by updating a comma-separated list of values to the
gcloud container clusters update
with--monitoring
flag. Here is an example:gcloud container clusters update gke1 \ --zone=us-west1-a \ --monitoring==SYSTEM,WORKLOAD
Google Cloud Monitoring API
Google Cloud Monitoring API refers to the API that is provided with Google Cloud operations suite to customize your Monitoring solution inside GKE platform.
Stackdriver reads this configuration to prescribe how it processes, manages, and responds to monitored events generated in the cluster.
For more details, refer to Introduction to the Cloud Monitoring API.