Help build the future of open source observability software Open positions

Check out the open source projects we support Downloads

Grot cannot remember your choice unless you click the consent notice at the bottom.

A 3-step guide to troubleshooting and visualizing Kubernetes with Grafana Cloud

A 3-step guide to troubleshooting and visualizing Kubernetes with Grafana Cloud

November 19, 2021 4 min

Back in May, we announced the Kubernetes integration to help users easily monitor and alert on core Kubernetes cluster metrics using the Grafana Agent, our lightweight observability data collector optimized for sending metric, log, and trace data to Grafana Cloud. Since then, we’ve made some improvements to help our customers go even further. 

This guide will show how easy it is to use Grafana Cloud to troubleshoot and alert on your Kubernetes cluster, and highlight all of the new features you should check out if you’re already using the k8s integration.

Step 1: Get the Kubernetes integration in Grafana Cloud

Setting up the integration is fast and easy. From the Grafana Cloud homepage UI, click on the lightning bolt integrations icon on the menu bar and select ‘Walkthrough’ under the Onboarding tab.

Grafana Cloud UI for adding integrations
Grafana Cloud UI for adding integrations

Search for Kubernetes and click install.

Search for K8s in the Grafana Cloud integrations UI
Search for K8s in the Grafana Cloud integrations UI

Step 2: Configure the Agent to scrape metrics 

The Kubernetes integration works by collecting metrics via the Grafana Agent.

The Agent is configured to periodically scrape targets from your Kubernetes cluster like kubelet, cadvisor , etc., eliminating any tedious custom configuration required when using Prometheus Operator. 

Diagram of Grafana Agent configured to scrape targets from K8s cluster
Diagram of Grafana Agent configured to scrape targets from K8s cluster

Use the guided configuration and code snippets provided to finish the install process.

Guided configuration in the Grafana Cloud UI to install K8s integration
Guided configuration in the Grafana Cloud UI to install K8s integration

You’ve now deployed the Agent into your cluster and configured it to scrape the kubelet and cadvisor endpoints, and you are shipping these scraped metrics to Grafana Cloud.

Final screen confirming installation of K8s integration for Grafana Cloud is complete
Final screen confirming installation of K8s integration for Grafana Cloud is complete

In addition to metrics, you can also deploy additional Agents to collect logs and traces in your Kubernetes clusters by referencing these quickstart guides:

Note: This is currently being done with manual edits to config snippet, but we hope to also make this easier in the future so stay tuned for even more configuration improvements. 

Step 3: Start using Kubernetes dashboards

Once you have finished installing the integration, you will have access to a number of dashboards so you can visualize your data being scraped.

List of dashboards in Grafana Cloud for the K8s integration
List of dashboards in Grafana Cloud for the K8s integration

Kubernetes integration home dashboard

Start with (Home) Kubernetes integration. From this “homepage” style dashboard, there are two “paths” that you can access which take you to several pre-built dashboards based on what you’re interested in: 

  1. Resource consumption visibility: compute resource dashboards at different levels, including pod, namespace, and cluster
  2. Cluster operations visibility: persistent volumes and kubelet dashboards
Screenshot of the K8s integration homepage in Grafana Cloud
Screenshot of the K8s integration homepage in Grafana Cloud

Cluster dashboard

Monitor your resource consumption across clusters by visualizing key indicators such as CPU & memory utilization, requests, and limits.

K8s integration cluster dashboard in Grafana Cloud
K8s integration cluster dashboard in Grafana Cloud

Namespace/workload dashboard

Visualize the resource consumption across your namespace/workload.

K8s integration namespace/workload dashboard in Grafana Cloud
K8s integration namespace/workload dashboard in Grafana Cloud

Kubelet dashboard 

High-level Kubernetes operational metrics from the Kubelet data source.

K8s integration kubelet dashboard in Grafana Cloud
K8s integration kubelet dashboard in Grafana Cloud

Persistent volumes dashboard 

Monitor and alert on persistent volume metrics such as disk and inode usage.

K8s integration persistent volumes dashboard in Grafana Cloud
K8s integration persistent volumes dashboard in Grafana Cloud

Get started with the Kubernetes integration

The Kubernetes integration is available for all Grafana Cloud users, and it’s just one of 40+ integrations that come bundled with working dashboards, live alerts, and ready-to-go configurations.

To learn more, check out the ObservabilityCON 2021 session on the Kubernetes, Datadog, and AWS CloudWatch integrations for Grafana Cloud. 

If you’re not already using Grafana Cloud, we have an actually useful free tier that includes 10k Prometheus metrics, 50GB Loki logs, 50GB Tempo traces, and three users. You can sign up for free now!

For more information on monitoring and alerting with the Kubernetes integration for Grafana Cloud, check out our documentation and our Kubernetes solutions page.

We’d also love to hear your feedback! Please join the #integrations channel in the Grafana Labs Community Slack.

Grafana Cloud is the easiest way to get started with metrics, logs, traces, and dashboards. We have a generous free forever tier and plans for every use case. Sign up for free now!