Skip to content

Monitoring with Prometheus

Prometheus is the gold standard for monitoring and metrics these daysm and there is a community built chart that provides a full suite of functionality:

  • Prometheus
  • Alertmanager
  • Grafana
  • Thanos

The chart is hosted at github and you can find more documentation there.

Install the chart

First we need to make sure we have the chart repo configured:

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

The prometheus chart requires a surprising amount of configuration, it's well worth examining the available options and figuring out which ones are important to you. You can fetch all configurable settings with the following command.

helm show values prometheus-community/kube-prometheus-stack

Once you have everything configured in a local values.yaml file, proceed with the installation:

helm upgrade \
  --install monitoring prometheus-community/kube-prometheus-stack \
  --create-namespace \
  -n monitoring \
  -f values.yaml

Examine the release status

kubectl -n monitoring get pods

You can see just how much this chart configures for you. You can find the service entries for grafana or prometheus if you want to have a look.

It's super-important to note the release name, in this case monitoring. When you configure a ServiceMonitor object later to monitor other sevices, you'll need to annotate it with that release name.

Next steps

Head to github to start configuring alerts, and monitoring other parts of your cluster.