This monitoring setup uses the kube-prometheus-stack helm chart. You will need to install helm before installing the chart.
- Get the pod name.
export POD_NAME=$(kubectl --namespace monitoring get pod -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=monitoring-setup" -oname)
- Use kubectl port-forward.
kubectl --namespace monitoring port-forward $POD_NAME 3000
- Access from
localhost:3000.
A dashboard can easily be exported as JSON using the Grafana UI by navigating to the dashboard and clicking the export button. When creating a new dashboard the option of importing a dashboard from JSON can be selected.
- Apply monitoring storageclass to cluster.
kubectl apply -f monitoring-storageclass-dev.yml
OR
kubectl apply -f monitoring-storageclass-prod.yml
- Install monitoring stack from helm chart with custom values.
helm install -f kube-prometheus-stack-values.yml -n monitoring monitoring-setup prometheus-community/kube-prometheus-stack --version 75.1.0
- Install OTP service monitors.
kubectl apply -f monitoring-servicemonitors.yml
helm upgrade -f kube-prometheus-stack-values.yml -n monitoring monitoring-setup prometheus-community/kube-prometheus-stack --version 75.1.0
Persistent storage is not removed by default when uninstalling!
- Remove OTP service monitors.
kubectl delete -f monitoring-servicemonitors.yml
- Remove monitoring stack.
helm uninstall -n monitoring monitoring-setup
- Remove monitoring storageclass from cluster.
kubectl delete -f monitoring-storageclass-dev.yml
OR
kubectl delete -f monitoring-storageclass-prod.yml
- View remaining persistent storage claims.
kubectl get pvc -n monitoring