How to create a ServiceMonitor in Microk8s: Observability Tutorial

Hello, In this quick tutorial we will explore how to create a ServiceMonitor in microk8s when you have the observability addon enabled. When you enable the observability addon with: 1 microk8s enable observability It will create the obserability namespace and install the Kubernetes Prometheus Stack. 1 2 3 4 5 6 7 8 9 10 11 k get pods -n observability NAME READY STATUS RESTARTS AGE kube-prom-stack-prometheus-node-exporter-htzw9 1/1 tempo-0 2/2 Running 4 (16h ago) 27h alertmanager-kube-prom-stack-kube-prome-alertmanager-0 2/2 kube-prom-stack-kube-prome-operator-cbf896985-fb5fc 1/1 kube-prom-stack-kube-state-metrics-57c8c84df6-hflgj 1/1 kube-prom-stack-grafana-74d8979894-sjv77 3/3 prometheus-kube-prom-stack-kube-prome-prometheus-0 2/2 loki-0 1/1 loki-promtail-sg8bv 1/1 Running You will get a Grafana configured with a Prometheus data source and other data sources as well. ...

March 29, 2023 · 2 min · Denis Nuțiu