| title | Kubernetes : Prometheus + Grafana |
|---|---|
| author | mikamboo |
| date | 2020-04-24 23:43 |
| cover | https://images.unsplash.com/photo-1515630278258-407f66498911?ixlib=rb-1.2.1&auto=format&fit=crop&w=1374&q=80 |
Monitor Kubernetes cluster using Prometheus + Grafana
- A ready to use kubenetes cluster
- Helm client wich can access to cluster
kubectl create namespace monitoring- Init Helm repos
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update- Install Prometheus + Grafana
helm install grafana --namespace monitoring grafana/grafana
helm install prometheus --namespace monitoring bitnami/prometheus- Prometheus: http://localhost:9090
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace monitoring port-forward $POD_NAME 9090- Grafana: http://localhost:3000
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app=grafana" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace monitoring port-forward $POD_NAME 3000
# Get "admin" password
kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo- Grafana datasource settings
Use following URL as Prometheus server url: http://prometheus-server.monitoring.svc.cluster.local
WARNING: Grafana - By default Persistence is disabled !!!
- Prometheus: https://prometheus.io
- Grafana: https://grafana.com
- Grafana dashboards to import
- Medium Install Prometheus and Grafana by Helm
- Tutorial Kube Prometheus Stack : https://stash.run/docs/v2020.12.17/guides/latest/monitoring/prometheus_operator/

Update 05/2022
All in one: Use
prometheus-communityHelm chartComportements
Installation
Get Helm Repository
Install Chart