Prometheus + Grafana
- Prometheus — scrapes and stores time-series metrics
- Grafana — dashboards and visualization on top
- The de facto open-source monitoring stack for Kubernetes
- Often installed together via a Helm chart (next deck)
Horizontal Pod Autoscaler (HPA)
-
Automatically scale replicas based on load (e.g. CPU)
kubectl autoscale deployment web --min=2 --max=10 --cpu-percent=70
-
Needs metrics-server and resource requests set
-
Desired state that adjusts itself to demand
Logging at scale
kubectl logs is fine for one pod, not a fleet
- Aggregate logs centrally (e.g. Loki, ELK/EFK stacks)
- Ship logs off the node so they survive pod deletion
Lab goals
- Enable metrics-server; use
kubectl top
- Add an HPA and drive load to watch it scale
- (Stretch) Install Prometheus + Grafana and open a dashboard