Interview Prep/Kubernetes/Resources, OOM, probes and termination

`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.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination