Helm is the easiest way to do this. Check out https://github.com/kubernetes/charts/tree/master/stable/prometheus
.
We can run helm install stable/prometheus
to get the stock prometheus server.
In this case, we will run: helm install stable/prometheus --name prom-demo -f values.yaml
to use our custom yaml.
Running minikube service prom-demo-prometheus-server
will bring up the browser with prometheus server running.
Check out kube_pod_status_phase
to see our all our pods running.
More info here: https://prometheus.io/docs/prometheus/latest/querying/operators/
but you can use the query language to clean up the data point we looked at above.
sum(kube_pod_status_phase) by (phase)
will return the set of pods that are running grouped by their phases.
The node exporter gives you node relative information as well like CPU/disk usage etc.
Run machine_cpu_cores
will return the CPU count which should match the number of CPU's in kubectl describe nodes
- Run the app:
kubectl apply -f twelve-clouds.yaml
- Visit the app after it's deployed:
minikube service twelve-clouds-service
- You'll see the
/metrics
endpoint with go stats - Visit the
/hello
endpoint 2 times. - You'll see a new "hello_calls" metric in the dashboard