Install kube-prometheus-stack with Helm and use kubectl top for real-time resource monitoring.
Monitoring with Prometheus and Grafana
# Install Prometheus stack with Helm
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install monitoring prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace
# Access Grafana
kubectl port-forward svc/monitoring-grafana 3000:80 -n monitoring
# Default login: admin / prom-operator
# Useful commands
kubectl top nodes
kubectl top pods
kubectl top pods --sort-by=memory
# Metrics server (required for kubectl top)
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml