Work in progress. Please fix me :)
To quickly start all the things just do this:
kubectl create --filename manifests/
Alternatively follow these steps to get a feeling for the different components of this setup:
kubectl create --filename manifests/prometheus-configmap.yaml
# kubectl get configmaps
# kubectl delete configmaps/prometheus
kubectl create --filename manifests/prometheus-service.yaml
# kubectl get services/prometheus
# minikube service prometheus
kubectl create --filename manifests/prometheus-deployment.yaml
# kubectl get --all-namespaces --output wide pods
# kubectl logs prometheus-2556266794-sd260
# kubectl delete pods/prometheus-2556266794-sd260
kubectl create --filename manifests/node-exporter-service.yaml
kubectl create --filename manifests/node-exporter-daemonset.yaml
kubectl create --filename manifests/grafana-service.yaml
# kubectl get services/grafana
# minikube service grafana
kubectl create --filename manifests/grafana-deployment.yaml
# kubectl get --all-namespaces --output wide pods
See grafana.net for some example dashboards and plugins.
-
Configure Prometheus data source for Grafana.
Grafana UI / Data Sources / Add data source
Name
:prometheus
Type
:Prometheus
Url
:http://prometheus:9090
Add
-
Import Prometheus Stats:
Grafana UI / Dashboards / Import
Grafana.net Dashboard
:https://grafana.net/dashboards/2
Load
Prometheus
:prometheus
Save & Open
-
Import Kubernetes cluster monitoring:
Grafana UI / Dashboards / Import
Grafana.net Dashboard
:https://grafana.net/dashboards/162
Load
Prometheus
:prometheus
Save & Open
Instead of manually configuring the datasource and dashboards you can run the following job. It uses the API to configure Grafana to a state similar to when you manually go through the steps described above.
kubectl create --filename manifests/grafana-import-dashboards-job.yaml