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.
More on Reliability Patterns in Production
Clients get 503s with body `upstream connect error or disconnect/reset before headers. reset reason: overflow`, and Envoy logs show flag `UO`.AdvancedNGINX ingress returns 504 and logs `upstream timed out (110: Connection timed out) while reading response header from upstream`.BeginnerAfter a 30-second database blip, Postgres keeps rejecting connections with `FATAL: sorry, too many clients already` for 20 minutes.AdvancedCustomers were charged twice during an incident where the payment API timed out.AdvancedEvery rolling deploy produces a short burst of 502s on the AWS ALB.IntermediateRedis restarted and immediately the database CPU hit 100% and the site went down.Advanced