Skip to content

kube-prometheus-stack

Introduction

The kube-prometheus-stack is an easy to manage but powerful way to operate a complete monitoring stack consisting of Prometheus, Alertmanager and Grafana. It makes use of the community managed Prometheus Operator which makes Kubernetes native Prometheus deployments a breeze.

The Prometheus Operator looks for ServiceMonitor and PodMonitor objects in all namespaces and adds them to it's list of scrape targets. Most Helm charts already provide those monitor objects behind a values flag. If there was no corresponding flag available a manual declaration was added to this repository as follows:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: cloudflared
  namespace: cloudflared
spec:
  endpoints:
    - port: http
      path: /metrics
      interval: 30s
  selector:
    matchLabels:
      app.kubernetes.io/name: cloudflared # references the target object (1)
  1. Selector label which references the target Service object to monitor.
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: cloudflared
  namespace: cloudflared
spec:
  podMetricsEndpoints:
    - port: http
  selector:
    matchLabels:
      app.kubernetes.io/name: cloudflared # references the target object (1)
  1. Selector label which references the target Pod object to monitor.

Created Resources

Kind Name
HelmRelease kube-prometheus-stack
Certificate prometheus.${DOMAIN_INTERNAL}, alerts.${DOMAIN_INTERNAL}, grafana.${DOMAIN_INTERNAL}
IngressRoute dashboard-prometheus, dashboard-alertmanager, dashboard-grafana
ConfigMap grafana-dashboard-nodes, grafana-dashboard-containers