Interview Prep/SRE & Reliability/Reliability Patterns in Production

The HPA does not scale during a load test: `failed to get cpu utilization: unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: the server could not find the requested resource (get pods.metrics.k8s.io)`.

BeginnerTroubleshootingReliability Patterns in Production
Answer

Likely causes → metrics-server is not installed or not healthy (on kind it often fails TLS to kubelets).

Diagnose →

kubectl get apiservice v1beta1.metrics.k8s.io
kubectl -n kube-system logs deploy/metrics-server | tail
kubectl top pods -n shop

Fix → Install metrics-server; on kind add --kubelet-insecure-tls to its args (lab only). Also make sure pods have CPU requests, or the HPA cannot compute utilization.

Prevent → Include metrics-server in the cluster baseline and alert if the APIService is unavailable.

All SRE & Reliability questions

More on Reliability Patterns in Production