🎓 A1Learner
🔍
0 of 50 lessons completed

Prometheus: kube-prometheus-stack

Kube-prometheus-stack is a Helm chart that installs a whole Prometheus monitoring setup on Kubernetes in one command. No live cluster was used for this lesson.

Add the chart repository

Helm fetches charts from a repository. This one belongs to the Prometheus community.

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

Install the stack

One install creates the whole monitoring setup in the monitoring namespace.

helm install kps prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace

List what the install created

The pods show one deployment per part of the stack, all running in monitoring.

kubectl get pods -n monitoring

Example

which helm kubectl kind minikube; echo "exit $?"

Key points

  • Helm chart: a packaged set of Kubernetes files that installs an app in one command.
  • The chart installs Prometheus, Alertmanager, Grafana, and the Prometheus Operator.
  • It also installs Node Exporter on every node and kube-state-metrics for the cluster.
  • Kube-state-metrics turns Kubernetes objects, such as pods and deployments, into metrics.
  • The chart ships about 29 ready-made Grafana dashboards for nodes, pods, and namespaces.
  • It also ships alerting and recording rules, so common cluster problems page you at once.
  • You install it into a namespace, usually one called monitoring, to keep it apart.
  • The stack is the bridge from this course into the Kubernetes Beginner course.

In this example, the lab machine has no Helm, no kubectl, and no local cluster tool at all, so the install command in this lesson was stated, not run. The chart's own docs give the install as one Helm command, and the Kubernetes Beginner course runs the real install. Claiming a live install here would be invention.

Note

No cluster was available for this lesson, so its commands are stated, not run.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

What does kube-prometheus-stack install in one Helm command?