Grafana Cloud

Configure Kubernetes Monitoring with a manual values file

You can configure Kubernetes Monitoring without the configuration wizard by writing your own Helm values file. Both paths install the same Grafana Kubernetes Monitoring Helm chart. The wizard generates the Helm values for you, while this path gives you full control of the values.yaml file from the start.

Before you begin

To configure Kubernetes Monitoring manually, you need:

  • A Grafana Cloud account
  • The Admin role to install alerts
  • To have completed the activation of the app
  • A Kubernetes Cluster, environment, or fleet you want to monitor
  • The kubectl and Helm command-line tools
  • Familiarity with Helm values files and the edit-then-redeploy workflow
  • Familiarity with the chart’s collectors, presets, features, and destinations. Refer to Key concepts.

Install the required rules

Kubernetes Monitoring requires recording and alert rules in your Grafana Cloud stack, and these rules install through Grafana Cloud, not through Helm. In Kubernetes Monitoring, go to the Cluster configuration tab of the Configuration page, and click Install under Backend Installation. For details, refer to Backend and distribution.

Build your values file

The chart requires four parts in your values.yaml file. For the full structure, refer to Build your values in the chart repository.

YAML
cluster: # Cluster configuration, including the Cluster name
  name: <CLUSTER_NAME>

destinations:
  myPrometheus:
    type: prometheus
    url: https://<PROMETHEUS_ENDPOINT>/api/prom/push
  myLoki:
    type: loki
    url: https://<LOKI_ENDPOINT>/loki/api/v1/push

# Features to enable, which determine what data to collect
clusterMetrics:
  enabled: true
  collector: alloy-metrics # References the collector defined below
clusterEvents:
  enabled: true
  collector: alloy-singleton # References the collector defined below

# Telemetry collector definitions
collectors:
  alloy-metrics:
    presets: [clustered, statefulset] # Share scrape targets and deploy as a StatefulSet
  alloy-singleton:
    presets: [singleton] # Cluster events must run as a single instance
  • Cluster name: A unique name for the Cluster. This name appears in dashboards, alerts, and Cluster selectors.
  • Destinations: Where each type of telemetry is delivered. Refer to Destinations and proxies. To authenticate to Grafana Cloud, use an access policy token, and refer to the authentication examples in the chart repository.
  • Features: What data to collect. When you define more than one collector, use each feature’s collector field to specify which collector it uses. Refer to Features for the full list.
  • Collectors: The Grafana Alloy instances that gather and send your telemetry, and the presets that set their shape. A Cluster events collector requires the singleton preset because Cluster events must run as a single instance. Refer to the collector reference.

Install the chart

  1. If you don’t already have the Grafana Helm charts repository, add it:

    Bash
    helm repo add grafana https://grafana.github.io/helm-charts

    If you already have it, update it:

    Bash
    helm repo update
  2. Install the chart with your values file. Make sure your kubectl context points to the Cluster you want to monitor:

    Bash
    helm upgrade --install grafana-k8s-monitoring grafana/k8s-monitoring \
      --namespace <NAMESPACE> --create-namespace \
      --values values.yaml

To install from the OCI registry instead, refer to the chart usage documentation.

Next steps