`kubectl top pods` returns `error: Metrics API not available`.
BeginnerTroubleshootingResources, OOM, probes and termination
Answer
Likely causes → metrics-server is not installed, is crash-looping, or its APIService v1beta1.metrics.k8s.io is unavailable (often TLS to kubelets or network from the API server to the metrics-server Pod).
Diagnose →
kubectl get apiservice v1beta1.metrics.k8s.io
kubectl -n kube-system get pods -l k8s-app=metrics-server
kubectl -n kube-system logs deploy/metrics-server --tail=50
Fix → Install metrics-server (kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml) or the EKS add-on. If logs show kubelet certificate errors, fix kubelet serving certs (or in labs only, --kubelet-insecure-tls).
Prevent → Treat metrics-server as a core add-on: HPA and VPA depend on it.
More on Resources, OOM, probes and termination
`kubectl describe pod` shows `Last State: Terminated, Reason: OOMKilled, Exit Code: 137`.BeginnerA Java service is OOMKilled at 2 GiB limit but the heap is only `-Xmx1800m`.IntermediateMany Pods on one node were killed at once and the node shows a `SystemOOM` event. Container limits were not reached.AdvancedPods show `Evicted` with `The node was low on resource: memory. Threshold quantity: 100Mi, available: 87Mi. Container app was using 1.4Gi, request is 256Mi`.IntermediateA Pod is evicted with `Pod ephemeral local storage usage exceeds the total limit of containers 1Gi`.Intermediatep99 latency spikes every few seconds, CPU usage graph shows only 40% of the limit.Advanced