Prometheus collects metrics (CPU, memory, HTTP requests), and Grafana visualizes them in dashboards โ giving you real-time visibility into your k3s cluster.
โ Why Helm?
It automates complex setups (RBAC, PVCs, Services) in one command.
Like installing a home security system:
- Prometheus = sensors (collect data)
- Grafana = monitoring screen (show alerts, trends)
kubectl create namespace monitoring
helm repo add prometheus-community <https://prometheus-community.github.io/helm-charts>
helm repo update
๐ก Weโll use the kube-prometheus-stack chart (includes Prometheus, Grafana, Alertmanager, and pre-built dashboards).
helm install prometheus prometheus-community/kube-prometheus-stack \\\\
--namespace monitoring \\\\
--set grafana.adminPassword="admin123" \\\\
--set prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.resources.requests.storage="10Gi"
โ What this does:
- Deploys Prometheus (with 10Gi persistent storage)
- Deploys Grafana (admin user:
admin, password:admin123)- Includes pre-configured dashboards for k3s
kubectl get pods -n monitoring
# Wait until all are Running (may take 2-3 mins)
kubectl get svc -n monitoring
# Note the Grafana service (usually `prometheus-grafana`)
# Port-forward to Grafana
kubectl port-forward svc/prometheus-grafana 3000:80 -n monitoring
Open in browser: