> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The kube prometheus stack Helm Chart

> Helm chart bundling Prometheus, Grafana, and exporters for Kubernetes observability.

Previously you may have deployed Prometheus and Grafana by hand. That approach is useful to learn what’s under the hood, but it becomes hard to scale in production: separate lifecycles for Prometheus and Grafana, manually wiring dashboards and data sources, and editing `prometheus.yml` each time you add a scrape target quickly becomes tedious.

Example of separate Deployments you might maintain:

```yaml theme={null}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: prometheus
  namespace: monitoring
spec:
  ...
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  namespace: monitoring
spec:
  ...
```

And an example `prometheus.yml` you would normally edit manually:

```yaml theme={null}
---
global:
  scrape_interval: 15s
  evaluation_interval: 15s
scrape_configs:
  - job_name: "prometheus"
    static_configs:
      - targets: ["localhost:9090"]

  - job_name: "kubernetes-nodes"
    kubernetes_sd_configs:
      - role: node
    relabel_configs:
      - source_labels: [__address__]
        regex: "(.*):10250"
        replacement: "${1}:9100"
        target_label: __address__
```

It doesn't scale well.

There are several turnkey solutions to address this. In this article we cover kube-prometheus-stack — a community-maintained Helm chart that provides a pre-wired Prometheus + Grafana monitoring stack. It bundles the Prometheus Operator, Prometheus, Grafana (with an attached Prometheus data source), kube-state-metrics, and sensible defaults so you get Kubernetes observability immediately after install.

kube-prometheus-stack is published in the Prometheus Community Helm repository:

* Repository: [https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack)

![A system architecture diagram of a kube‑Prometheus monitoring stack showing Prometheus pulling metrics from client libraries and exporters, storing data in local storage, and using service discovery. It also shows Alertmanager sending notifications to OpsGenie/PagerDuty and Grafana used for data visualization.](https://mintcdn.com/kodekloud-c4ac6d9a/qM9vA-hQoWNCxcKa/images/Grafana-Prometheus-for-Metrics-Driven-Observability/Prometheus-and-Grafana-Introduction/The-kube-prometheus-stack-Helm-Chart/kube-prometheus-monitoring-stack-architecture.jpg?fit=max\&auto=format\&n=qM9vA-hQoWNCxcKa\&q=85\&s=936cd45d622e39c1bbb6d6cfd0e05262)

What kube-prometheus-stack gives you out of the box

* Prometheus Operator: manages Prometheus instances and dynamic configuration via Kubernetes CRDs.
* Prometheus: a production-ready server configured to store and query metrics.
* Grafana: pre-configured with a Prometheus data source and optional dashboards.
* kube-state-metrics: exports Kubernetes object-level metrics (Deployments, Pods, Services, PVCs, Namespaces, etc.).
* Alertmanager and example alerting rules (configurable via values).

The big win: Kubernetes infrastructure metrics flow into Prometheus immediately after install.

![A slide titled "Kubernetes Infrastructure Scraping Pre-Packaged" showing the kube-state-metrics logo in the center surrounded by names of Kubernetes resources (Pods, Deployments, Services, PersistentVolumes, Namespaces, etc.). Kubelet and API icons are shown to the left and right of the central graphic.](https://mintcdn.com/kodekloud-c4ac6d9a/qM9vA-hQoWNCxcKa/images/Grafana-Prometheus-for-Metrics-Driven-Observability/Prometheus-and-Grafana-Introduction/The-kube-prometheus-stack-Helm-Chart/kube-state-metrics-kubernetes-resources.jpg?fit=max\&auto=format\&n=qM9vA-hQoWNCxcKa\&q=85\&s=dfa4439e5e50a9a743a04a8e583f3313)

Without adding any custom scrape targets, kube-prometheus-stack will already collect metrics from:

* kubelet and node-exporter (node-level CPU, memory, network)
* kube-apiserver (request rates and latencies)
* kube-state-metrics (object state such as pod\_count, deployment\_replicas, pvc\_capacity)
* Prometheus self-metrics

That means container CPU, memory, network metrics, API server request rates, pod states, and much more are available in Prometheus immediately.

![A diagram titled "Kubernetes Infrastructure Scraping Pre-Packaged" showing Prometheus pulling metrics from Kubernetes components (kubelet, API) and storing them. The stored metrics listed include CPU, memory, network metrics, API-server request rates, pod states, etc.](https://mintcdn.com/kodekloud-c4ac6d9a/qM9vA-hQoWNCxcKa/images/Grafana-Prometheus-for-Metrics-Driven-Observability/Prometheus-and-Grafana-Introduction/The-kube-prometheus-stack-Helm-Chart/kubernetes-prometheus-scraping-infrastructure-metrics.jpg?fit=max\&auto=format\&n=qM9vA-hQoWNCxcKa\&q=85\&s=5d6a09f430b6512661222bb287bceea6)

Key operational difference: you do not edit `prometheus.yml` directly. The Prometheus Operator configures Prometheus dynamically using Kubernetes Custom Resources such as ServiceMonitor and PodMonitor.

What is a ServiceMonitor?
A ServiceMonitor is a Kubernetes manifest that tells Prometheus (via the Operator) what Service to scrape, which port/path to use, and the scrape interval. You can create ServiceMonitor resources alongside your application manifests so that Prometheus automatically discovers and scrapes your app.

Example ServiceMonitor:

```yaml theme={null}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: order-backend
  namespace: monitoring
  labels:
    app: order-backend
    release: prometheus-stack
spec:
  selector:
    matchLabels:
      app: order-backend
  namespaceSelector:
    matchNames:
      - default
  endpoints:
    - port: http
      path: /metrics
      interval: 15s
      scrapeTimeout: 10s
```

The Prometheus Operator watches for ServiceMonitors and updates Prometheus configuration automatically. Add a ServiceMonitor and Prometheus starts scraping; delete it and Prometheus stops — no restarts or manual edits required. This is the recommended pattern for production workloads because it keeps monitoring configuration declarative and lifecycle-aligned with your application.

Make sure Prometheus is configured to discover ServiceMonitors via its `serviceMonitorSelector` (controlled by chart values). Using labels such as `release: prometheus-stack` is common so Prometheus only selects ServiceMonitors created for that chart release.

Quick install example (Helm)

```bash theme={null}
# add the repo
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update

# install the chart in namespace monitoring
helm install prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace
```

After installation:

* Grafana will be deployed with a Prometheus data source already configured.
* Prometheus and Alertmanager will be deployed and managing their configs via CRDs.
* kube-state-metrics and node exporters will be scraping cluster-level metrics.

Table: manual deployment vs kube-prometheus-stack

| Concern | Manual (single components) | kube-prometheus-stack (Helm) |
| - | - | - |
| Installation | Deploy Prometheus, Grafana, exporters separately | Single Helm install wires everything |
| Config management | Edit `prometheus.yml` manually and restart | Declarative CRDs (ServiceMonitor, PodMonitor) managed by Operator |
| Dashboards | Configure Grafana data sources & dashboards manually | Grafana preconfigured; community dashboards available |
| Scalability | Harder to maintain as targets grow | Add ServiceMonitors; Operator updates Prometheus config automatically |
| Recommended for production | Possible, but labor-intensive | Recommended for most Kubernetes monitoring use-cases |

Apply your application and ServiceMonitor:

```bash theme={null}
kubectl apply -f deployment.yaml
kubectl apply -f servicemonitor.yaml
```

Links and further reading

* kube-prometheus-stack Helm chart: [https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack)
* Prometheus Operator and CRDs: [https://github.com/prometheus-operator/prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)
* ServiceMonitor documentation: [https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md)

Summary
kube-prometheus-stack significantly reduces operational overhead by bundling Prometheus, Grafana, and exporters with the Prometheus Operator to enable declarative monitoring with ServiceMonitors and PodMonitors. Install once and start observing your cluster and applications immediately; then add ServiceMonitors as part of your application manifests to scale monitoring safely and predictably.

> [card] [Watch Video](https://learn.kodekloud.com/user/courses/grafana-prometheus-for-metrics-driven-observability/module/86c79392-532c-42b7-8908-18bf0a84210b/lesson/a3507093-39cd-410f-8fe0-557a12000d6c)

> [card] [Practice Lab](https://learn.kodekloud.com/user/courses/grafana-prometheus-for-metrics-driven-observability/module/86c79392-532c-42b7-8908-18bf0a84210b/lesson/62a49fce-1b34-40b8-8d5b-903727b631f7)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.