๐ŸŽฏ What It Is

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.

๐Ÿ’ก Real-World Analogy

Like installing a home security system:


๐Ÿงช Step-by-Step: Install on k3s

๐Ÿ”ง Step 1: Create a Monitoring Namespace

kubectl create namespace monitoring

๐Ÿ”ง Step 2: Add Prometheus Helm Repo

helm repo add prometheus-community <https://prometheus-community.github.io/helm-charts>
helm repo update

๐Ÿ”ง Step 3: Install Prometheus + Grafana (All-in-One)

๐Ÿ’ก 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:

๐Ÿ”ง Step 4: Verify Installation

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`)

๐Ÿ”ง Step 5: Access Grafana Dashboard

# Port-forward to Grafana
kubectl port-forward svc/prometheus-grafana 3000:80 -n monitoring

Open in browser: