Learn about the Wavefront Kubernetes Integration.

Kubernetes Integration

Wavefront provides a comprehensive solution for monitoring Kubernetes. This integration uses the Wavefront Collector for Kubernetes to collect detailed metrics from Kubernetes clusters.

Collection

The collector makes it easy for you to monitor and manage your Kubernetes environment:

  • Collects real-time metrics from all layers of a Kubernetes environment (clusters, nodes, pods, containers and the Kubernetes control plane).
  • Supports plugins such as Prometheus, Telegraf and Systemd enabling you to collect metrics from various workloads.
  • Auto discovery of pods and services based on annotation and configuration.
  • Daemonset mode for high scalability with leader election for monitoring cluster-level resources.
  • Rich filtering support.
  • Auto reload of configuration changes.
  • Internal metrics for tracking the collector health and source of your Kubernetes metrics.

Dashboards

In addition to setting up the metrics flow, this integration also installs dashboards:

  • Kubernetes: Detailed health of your infrastructure and workloads.
  • Kubernetes Metrics by Namespace: Details of your pods/containers broken down by namespace.
  • Kube-state metrics: State of Kubernetes objects such as pods, services, deployments and daemonsets.
  • Kubernetes Collector Metrics: Internal stats of the Collector.

Here’s a preview of some of the pod charts in the Kubernetes dashboard:

images/db_kubernetes_pods.png

Here’s a preview of some of the charts from kube-state-metrics dashboard:

images/kube-state-dashboard.png

Kubernetes Setup

This integration uses the Wavefront Collector for Kubernetes to monitor your Kubernetes clusters.

OpenShift Installation

Follow these steps for installing the Wavefront Collector in an OpenShift environment. Refer to the Kubernetes Quick Install using Helm or Kubernetes Manual Install for installing the collector in all other Kubernetes environments.

The collector supports monitoring of Openshift clusters:

Kubernetes Quick Install Using Helm

Ensure that you have installed helm.

To deploy the Wavefront Collector and Wavefront Proxy using helm 2:

helm install stable/wavefront --name wavefront --set wavefront.url=https://YOUR_CLUSTER.wavefront.com --set wavefront.token=YOUR_API_TOKEN --set clusterName=<YOUR_CLUSTER_NAME> --namespace wavefront

To deploy the Wavefront Collector and Wavefront Proxy using helm 3:

helm install wavefront stable/wavefront --set wavefront.url=https://YOUR_CLUSTER.wavefront.com --set wavefront.token=YOUR_API_TOKEN --set clusterName=<YOUR_CLUSTER_NAME> --namespace wavefront

Note: The clusterName property refers to the Kubernetes cluster, for example, dev-cluster. You must set this property.

Refer to the Wavefront helm chart for further options.

Kubernetes Manual Install

Follow the instructions below to manually set up Kubernetes monitoring.

Step 1. Deploy a Wavefront Proxy in Kubernetes

  1. Download wavefront.yaml to your system.
  2. Edit the file and set WAVEFRONT_URL to https://YOUR_CLUSTER.wavefront.com/api/ and WAVEFRONT_TOKEN to YOUR_API_TOKEN.
  3. Run kubectl create -f </path/to>/wavefront.yaml to deploy the proxy.

The Wavefront proxy and a wavefront-proxy service should now be running in Kubernetes.

Step 2. Deploy the kube-state-metrics Service

  1. Download kube-state.yaml to your system.
  2. Run kubectl create -f </path/to>/kube-state.yaml.

The kube-state-metrics service should now be running on your cluster.

Step 3. Deploy Wavefront Collector for Kubernetes

  1. Download the following deployment files to a directory named wavefront-collector-dir on your system:
  2. Edit 4-collector-config.yaml and replace clusterName: k8s-cluster to uniquely identify your Kubernetes cluster.

  3. If RBAC is disabled in your Kubernetes cluster, edit 5-collector-daemonset.yaml and comment out serviceAccountName: wavefront-collector.

  4. Run kubectl create -f </path/to/wavefront-collector-dir>/ to deploy the collector on your cluster.

To verify the collector is deployed, run kubectl get pods -n wavefront-collector.

Application and Service Auto Discovery

The Wavefront Collector can auto discover applications and services within a Kubernetes environment and automatically start collecting metrics.

The default configuration file includes discovery configurations for a number of common applications such as Consul, Redis, Memcached, etc. Uncomment the configurations for the applications you wish to monitor, and customize the rules as relevant to your environment.

Troubleshooting

If you do not see metrics in the Kubernetes dashboard, check the logs from the collector and proxy pods.

Horizontal Pod Autoscaling (HPA)

Wavefront provides a HPA adapter for autoscaling your pods based on any metrics in Wavefront. See wavefront-kubernetes-adapter for details.