Customizing Kubernetes Monitoring

The information on this page is useful if you want to understand or customize the standard configuration of Stackdriver Kubernetes Monitoring.

Kubernetes Monitoring implementation

This section provides useful information if you need to customize your Kubernetes configuration for Stackdriver.

Stackdriver Kubernetes Monitoring is implemented by three Stackdriver agents running in the kube-system namespace:

  • The Stackdriver Metadata Agent (metadata-...) records the current set of nodes, containers, pods, etc.
  • The Stackdriver Logging Agent (fluentd-gcp-...) sends log entries to Stackdriver Logging.
  • The Stackdriver Monitoring Agent (heapster...) sends metric data to Stackdriver Monitoring. This includes metrics from Prometheus.

The following diagram shows how these agents are organized.

Kubernetes Monitoring Architecture

Configuration files

When you enable Stackdriver Kubernetes Monitoring in a cluster using the monitoring console or gcloud, the Stackdriver agents are installed as if by the following commands:

kubectl apply -f https://storage.googleapis.com/stackdriver-gke-beta/configs/namespace.yaml

kubectl apply -f https://storage.googleapis.com/stackdriver-gke-beta/configs/rbac-setup.yaml \
  --as=admin --as-group=system:masters

kubectl apply \
  -f https://storage.googleapis.com/stackdriver-gke-beta/configs/metadata-agent.yaml \
  -f https://storage.googleapis.com/stackdriver-gke-beta/configs/logging-agent.yaml \
  -f https://storage.googleapis.com/stackdriver-gke-beta/configs/heapster-new-resources.yaml

kubectl create configmap \
  --namespace=stackdriver-agents \
  --from-literal=cluster_name=[CLUSTER_NAME] \
  --from-literal=cluster_location=[CLUSTER_LOCATION] \
  heapster-config

The individual configuration files are described below:

Stackdriver monitored resource types

Stackdriver labels each log entry and metric datum with a monitored resource that identifies the origin of the information. The resource types associated with Stackdriver Kubernetes Monitoring, for both monitoring and logging, are listed below:

These types are not the same as those used by the former Stackdriver support. For a discussion of this incompatibility and how to migrate your existing cluster, see Migrating to Stackdriver Kubernetes Monitoring.

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

Send feedback about...

Stackdriver Monitoring