Kubernetes monitoring with kube-prometheus-stack

kube-prometheus-stack gives a self-managed cluster a monitoring baseline in one Helm chart. This page covers what it installs, how to size and configure it, and what production needs beyond the defaults.

On this page

Kubernetes monitoring with kube-prometheus-stack: what it installs and when you need it

kube-prometheus-stack is a Helm chart that installs a complete monitoring baseline for a Kubernetes cluster: Prometheus for metrics, Alertmanager for alert routing, Grafana for dashboards, exporters for cluster and node data, and the Prometheus Operator to manage it all through Kubernetes resources. Teams adopt it when a self-managed cluster is running workloads but has no agreed answer to basic questions such as which nodes are under pressure, whether the API server is slow, or who gets paged when a deployment stops scaling. The chart is the usual first step because it ships with a set of bundled dashboards and alert rules that cover the control plane, nodes, pods and workloads, so the team starts from a working baseline rather than writing every rule from scratch.

In practice the bundle is made of several parts you should understand before installing. The Prometheus Operator turns monitoring configuration into custom resources such as ServiceMonitor, PodMonitor and PrometheusRule, so teams declare what to scrape and which alerts to evaluate next to their applications. Node-level and cluster-level exporters supply the raw signals, and the bundled dashboards and rules are generated from them. Prometheus itself is licensed under Apache-2.0 and has no paid enterprise edition, so the cost of the stack is not a license fee. It comes from the infrastructure that runs it, the storage that holds its data, the implementation work to tune it, and the people who operate and upgrade it. Confirm with your own team which of these you can staff before you commit to the design.

Before you install, confirm three things with the people who will own the stack: where the Prometheus data will live and for how long, who receives alerts and through which channels, and whether Grafana needs single sign-on from your identity provider. Those answers determine the storage class, the retention settings and the Alertmanager and Grafana configuration. Read the Prometheus storage documentation before you size anything, because it states that local storage is not clustered or replicated. A default single Prometheus instance is therefore a single point of failure for your monitoring, and a cluster outage can take your visibility down with it. Treat that as a design decision to make now, not after the first incident.

Which configuration choices fit which cluster

This table compares the main configuration choices for a kube-prometheus-stack baseline and states when each fits and what it costs in operational effort. Read each row against your retention needs, number of clusters and who must be able to sign in to Grafana. The main takeaway is that single-node local storage and SQLite suit small, short-lived setups, while longer retention and team access usually push you toward remote storage, clustered Alertmanager and a shared Grafana database.

ChoiceFits whenTrade-off
Single Prometheus with local storageOne cluster, a retention window measured in days, and a team that can tolerate a short gap during a node or disk failureLocal storage is not clustered or replicated, so you must back up and manage it like any single-node database. Default retention is 15 days unless you change it.
Prometheus with remote write to long-term storageYou need longer history, queries across clusters, or data that survives loss of the in-cluster Prometheus hostAdds a second system to size, secure and monitor. Remote write and remote read protocols are the integration point, so confirm the receiving system's supported setup before you commit.
Single Alertmanager instanceA lab, a non-critical cluster or a team that accepts that alert delivery stops if the one instance failsA single instance is simpler to run but is a single point of failure for paging. Silences and grouping state also live on that one node.
Alertmanager clusterAlerts must still reach on-call during an Alertmanager node failure, which is typical for production pagingRequires the cluster flags and a plan for peer networking. Prometheus should list every Alertmanager instance directly, not send alerts through a load balancer.
Grafana with SQLiteA small single-user or evaluation instance, such as a short proof of concept with few concurrent usersThe Grafana installation docs say SQLite does not scale for production. Upgrades and restores are also tied to one local database file.
Grafana with MySQL or PostgreSQLProduction use, several operators, or any setup that needs high availabilityYou run and back up another database. Versions must meet the supported minimums in the Grafana docs (MySQL 8.0 or later, PostgreSQL 12 or later).
Grafana high availabilityDashboards and alerting must stay reachable during a node failureThe docs require two or more active-active servers behind a load balancer sharing that database. Alerting needs extra configuration to avoid duplicate notifications, and Grafana Live has limitations in this mode.
Grafana local accounts or in-chart loginA short evaluation where no central directory exists yetEach user and role is managed in Grafana itself, which becomes hard to audit as the team grows.
Grafana with external identityYour organization already runs a directory or identity provider and needs access removed when people leaveGrafana authentication docs list LDAP, generic OAuth, Entra ID, Okta, GitHub, GitLab, Google OAuth, auth proxy and JWT in all editions. SAML, team sync, active sync and SCIM are limited to Grafana Enterprise and Grafana Cloud, so confirm which features you need before choosing.

How to install kube-prometheus-stack step by step

This sequence takes a cluster from no monitoring to a verified baseline: Prometheus scraping targets, Alertmanager routing the bundled alerts, and Grafana showing the bundled dashboards.

  1. Confirm prerequisites and create the namespace

    The platform team confirms cluster access with kubectl, a working Helm client, and a storage class that can provision persistent volumes for Prometheus and Alertmanager. They create a dedicated monitoring namespace so RBAC and network policy can be scoped to it. Confirm the Kubernetes version against the current release pages, since the chart supports a range of versions and the cluster must be inside the supported skew. Done when kubectl get ns monitoring returns the namespace and kubectl get storageclass shows a default or named class for the volumes.

  2. Pin the chart version and review values

    Add the prometheus-community Helm repository, then search it for the kube-prometheus-stack chart and record the exact chart version you will install. Confirm the bundled Prometheus, Alertmanager, Grafana and exporter versions against the chart's release notes, not from memory. Export the default values with helm show values and write an override file that sets retention, storage size, resource requests and the Alertmanager receivers you will use. Done when the override file is committed to version control and helm template renders without errors against it.

  3. Install the chart with Helm

    The platform team runs helm install or helm upgrade --install with the pinned chart version, the monitoring namespace and the override file. The chart creates the Prometheus Operator, the Prometheus, Alertmanager and Grafana custom resources, exporters and their RBAC. Watch the rollout until the operator, Prometheus, Alertmanager and Grafana pods report ready. Done when helm status reports deployed and kubectl get pods -n monitoring shows every pod Running with all containers ready.

  4. Verify targets and ServiceMonitor discovery

    Port-forward the Prometheus service and open the Targets page, or query the targets API, to confirm that the node exporter, kube-state-metrics, kubelet and API server targets are up. Then list the ServiceMonitor and PodMonitor resources in the cluster and check that your application namespaces are selected by the Prometheus custom resource's selectors. Confirm that namespace and label selectors match the workloads you expect, because a label mismatch is the most common reason a target never appears. Done when the expected jobs show as up and a test ServiceMonitor you create appears as a new target within the scrape cycle.

  5. Confirm alert rules load and route to Alertmanager

    Check the Rules page in the Prometheus UI to confirm the bundled PrometheusRule resources loaded without parse errors, then review which alerts are firing in a healthy cluster. Port-forward Alertmanager and confirm that Prometheus lists every Alertmanager instance as an active target, since Prometheus should point at each instance rather than a load balancer. Send a test alert with a disposable rule or the Alertmanager API and confirm it reaches the receiver you configured. Done when a test notification arrives and the routing tree in the Alertmanager status page matches the override file.

  6. Check bundled Grafana dashboards and data source

    Port-forward Grafana and sign in with the credentials your team set, not the chart defaults. Confirm the Prometheus data source is provisioned and its test succeeds, then open the bundled Kubernetes dashboards for nodes, pods and workloads and check that panels return data for the last few minutes. If a dashboard is empty, check the data source name and the cluster label rather than assuming a scrape failure. Done when at least the cluster compute and node dashboards render live series and the data source health check reports success.

  7. Record the baseline and confirm versions before production

    Export the final rendered manifests or the Helm values in use, store them with the chart version, and note the Prometheus retention and volume size as deployed. Confirm the current Prometheus, Grafana and chart release lines against their release pages before you promote the setup, because security fixes and end-of-life dates change. Record which additions are still needed for production, such as long-term storage, high availability for Alertmanager and authentication for Grafana. Done when a written baseline lists chart version, component versions, retention settings and the open production items, and the team has agreed who owns the upgrade cadence.

How retention and storage sizing decide the Prometheus design

Retention and storage sizing decide how the kube-prometheus-stack monitoring layer is built, because they determine how much history the cluster keeps and how much disk the Prometheus instance needs. Prometheus stores samples in a local time series database that writes data into two-hour blocks, with a write-ahead log protecting recent samples until they are compacted. The default retention is 15 days, and you can set retention by time or by size through the Prometheus retention flags. In the chart, these values are typically set through the Prometheus custom resource so that the Operator renders them into the running pods. Decide early whether you need 15 days of history, a longer window for capacity trends, or a size cap that protects the volume.

Size the volume from four inputs: the number of active series, the scrape interval, the retention window and the performance of the storage class. Series count is driven by the workloads you scrape and by label design, so a few high-cardinality metrics can change the answer more than the retention setting does. Scrape interval and the number of targets set the ingestion rate, and retention multiplies that rate into disk use. Volume performance affects compaction and query latency, not only capacity. Do not take numbers from a generic guide. Measure active series and ingested samples per second on your own cluster for a representative period, then test the chosen volume under query load before you commit to a size.

A single Prometheus server is a single-node database. Its local storage is not clustered or replicated, so a failed volume or pod loses the data on it unless you back up the volume or ship data to remote storage through remote write. Plan for that in advance: snapshot or back up the Prometheus volume, monitor disk usage and free space with alerts that fire before the volume fills, and confirm how long a restore takes. The Prometheus storage documentation explains the remote write and read interfaces that long-term storage builds on. Treat the Prometheus instance as a stateful service with its own recovery procedure, not as a stateless workload.

How the monitoring components connect in the cluster

The flow starts with the Prometheus Operator, which turns ServiceMonitor and PodMonitor resources into scrape configuration, so Prometheus pulls from kubelet, API server and exporter endpoints it discovers. Prometheus stores samples on local disk, evaluates alert rules, and sends alerts to every Alertmanager instance, not through a load balancer. Grafana queries Prometheus, and remote write is an optional branch to external long-term storage. Check that the metrics endpoints and Grafana sit inside the trust boundary and that each Alertmanager address is listed in Prometheus.

Scrape, store, alert and query paths for kube-prometheus-stack, with the metrics trust boundary marked.

What to add before this baseline runs production workloads

The chart gives a working baseline, but it stores metrics on a single local Prometheus and leaves alerting, dashboards, access and control plane coverage to you. The cards below cover the components and checks that turn this baseline into something your operations and security teams can rely on.

External long-term storage via remote write

Prometheus keeps data in a local time series database with a default retention of 15 days, and its storage is not clustered or replicated. Remote write sends samples to external long-term storage, so history survives a lost or rebuilt Prometheus pod. Decide the storage system, its retention and who can query it before you set the retention in the chart. Check that a failed remote endpoint does not silently drop data your incident reviews depend on.

Prometheus storage docs

Alertmanager high availability and routing

Alertmanager groups, inhibits and silences alerts, and it can run as a cluster for high availability. Prometheus should be configured with every Alertmanager instance, not a load balancer in front of them. Define receiver routing by severity and owning team, so pages reach an on-call rotation and lower-priority alerts go to a ticket queue. Test each receiver with a synthetic alert and confirm that a single Alertmanager failure does not stop notifications.

Alertmanager docs

Grafana on MySQL or PostgreSQL with SSO

Grafana defaults to SQLite, which does not scale for production, so run it on MySQL 8.0 or later or PostgreSQL 12 or later. High availability uses two or more active-active Grafana servers behind a load balancer, and alerting needs extra configuration to avoid duplicate notifications. Plan SSO early: LDAP, generic OAuth and other providers are available in all editions, while SAML, team sync and SCIM are limited to Grafana Enterprise and Grafana Cloud. Confirm which provisioning features your edition supports.

Grafana HA docs

Dashboards and alert rules as code

Dashboards, data sources and alerting resources can be defined in YAML or JSON files and loaded at startup through Grafana provisioning. Store these files, along with the Prometheus rule resources and chart values, in a Git repository and deploy them through your normal review process. This makes a rebuilt monitoring stack reproducible and gives you a history of who changed a threshold. Edits made directly in the UI will be overwritten on restart, so agree on that rule with your team before go-live.

Grafana provisioning docs

Monitoring the control plane and etcd

The bundled rules cover many workloads, but the components that break whole clusters need explicit alerts. Plan coverage for API server latency and errors, scheduler and controller health, etcd disk sync and leader changes, and certificate expiry. Kubernetes recommends a five-member etcd cluster in production and a backup plan for etcd data, so alert on backup job failures too. Confirm which control plane metrics your distribution exposes, since scrape endpoints differ by installation method.

Separating metrics access from users

Prometheus has no built-in user authentication, so its query and admin endpoints must sit behind controls you design. Expose Grafana to people through SSO and keep the Prometheus and Alertmanager web interfaces on an internal network for operators only. Restrict the Grafana metrics endpoint to authenticated scrapers, and limit who can change alert routing or silence alerts. Document which teams can read which namespaces, since metrics labels can reveal workload and tenant names.

Prometheus security model

Questions teams ask before deploying kube-prometheus-stack

What does kube-prometheus-stack cost to run?

The chart itself is open source, and Prometheus is licensed under Apache-2.0 with no paid enterprise edition, so the cost comes from four places: the compute that runs Prometheus, Alertmanager and Grafana, the storage that holds metric data, the implementation work, and the staff who operate it. Infrastructure and storage recur every month and grow with the number of series, scrape interval and retention period. Implementation is one-time work, while patching, upgrades and alert tuning recur. Ask any partner for a quote that separates these components, states which ones are one-time and which recur, and names the retention and cluster count the figures assume.

What drives the cost of storage for Prometheus?

Storage grows with how many time series you keep, how often you scrape them, and how long you retain them. Prometheus keeps data in a local time series database organized into two-hour blocks, and its default retention is 15 days, configurable by time or size. Longer retention on local disk means larger persistent volumes that you must size, back up and monitor. If you need months of history or cross-cluster queries, plan for remote write to external long-term storage rather than stretching local retention. Confirm the expected series count and retention with your team before sizing volumes.

How long does a baseline kube-prometheus-stack deployment take?

Duration depends on the number of clusters, how many workloads and exporters need scrape configuration, whether Alertmanager routes to existing paging tools, and how much of the bundled alert and dashboard set your team reviews before it goes live. A single cluster with default targets and internal notification channels is a much shorter job than several clusters with custom ServiceMonitors, SSO for Grafana and paging integration. Agree the duration in a written scope that lists clusters, targets, notification channels and acceptance tests. Treat any timeline you are given as an estimate until that scope is fixed.

What does the work need from our team?

You need named owners for four things: the Kubernetes clusters and their namespaces, the storage class that will hold Prometheus volumes, the on-call rota that receives alerts, and the people who decide which alerts page someone and which go to a ticket queue. You also need access to the clusters with rights to install a Helm chart and create custom resources, plus a place to store chart values under version control. Expect reviewers from security or compliance to ask about who can read metrics and Grafana dashboards, so assign that decision early.

Can a competent internal team deploy it without a partner?

Yes, a team that already runs Kubernetes and Helm can install the chart and get Prometheus, Alertmanager and Grafana running. The harder work is ongoing: tuning the bundled alert rules to your workloads, choosing retention and storage, configuring Alertmanager high availability, securing Grafana, and keeping the chart and components upgraded on their own release schedules. Prometheus releases come every six weeks for minor versions, and LTS lines receive bug fixes for one year, so someone must own that cadence. Decide whether that person is in your team before deciding who builds the stack.

When should we bring in an implementation partner?

Bring in a partner when the stack must pass a security or compliance review on a fixed date, when several clusters need consistent configuration, when you need Alertmanager and Grafana connected to SSO and paging tools, or when your team lacks time to own the upgrade and tuning work. A partner is also useful for a documented baseline that your team can run afterward. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted platforms inside your own infrastructure, and most engagements are fixed-scope with deliverables agreed in writing before work starts.

How does Grafana licensing affect our choice?

Grafana, Loki and Tempo moved from Apache License 2.0 to AGPLv3 on April 20, 2021, while Grafana Enterprise is offered as a non-AGPL commercial option. Your legal and procurement teams should confirm whether AGPLv3 obligations fit how you will run and modify Grafana, because that depends on your use, not on the chart. Some authentication options, including SAML, team sync and SCIM provisioning, are available only in Grafana Enterprise and Grafana Cloud, so check your SSO requirements against the authentication docs before you commit. Prometheus itself carries no license fee, so this decision affects only the visualization layer.

How DeployOpen scopes and delivers this monitoring baseline

DeployOpen works on fixed scope agreed in writing before any work starts. For a kube-prometheus-stack baseline, that scope usually names the clusters in question, the namespaces the stack will cover, the Helm chart version and values files to be delivered, the alert rules and dashboards in use, the retention and storage settings, and the Alertmanager receivers that will page people. Deliverables and timelines are set in the same document, so your platform team knows what it is receiving and what it must provide, such as storage classes, DNS names, ingress or access to the notification channels. Before signing, confirm which of these items your environment already has and which ones the scope must cover.

All of the work runs inside your own clusters, cloud accounts or data centers, including air-gapped networks where images must come from a private registry you operate. DeployOpen documents the Helm values, the PrometheusRule and ServiceMonitor resources, the retention and sizing assumptions and the runbook for each alert, so that your engineers can review them and change them later without outside help. Treat that documentation as a deliverable to check during handover, not as a formality. Ask for the exact file list and the owner of each file in the written scope.

The cost of this work is mostly people time: the design, the implementation, the review sessions and the handover. Infrastructure and storage costs are paid to your own providers and recur as the stack runs. Once the baseline is live, upgrades to the chart, Prometheus, Alertmanager and Grafana need planning, and alert rules need tuning as workloads change. DeployOpen offers retainers for upgrades and ongoing support. A quote follows from the written scope, and DeployOpen does not publish a price list, so the quote request should state the number of clusters, the expected retention window and whether long-term storage or multi-cluster views are included.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.