Based on https://github.com/coreos/kube-prometheus
With ideas from https://github.com/carlosedp/cluster-monitoring
Basically provide Prometheus' relevant ServiceMonitors with endpoints for kubernetes controller manager and kubernetes scheduler services.
Requirements:
Inspect and adapt if needed prometheus.jsonnet
Set your default kubernetes cluster context accordingly pointing to the target k3s cluster.
$ jb update
$ ./build
$ kubectl apply -f manifests/setup
- Wait few seconds as previous commands creates all the CRDs needed by prometheus-operator
$ kubectl apply -f manifests
You can follow the process with:
$ kubectl -n monitoring get pods -w
for example