`kubectl top pods` returns `error: Metrics API not available`
BeginnerTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer
Likely causes → metrics-server is not installed or its APIService is unavailable (often TLS to kubelets).
Diagnose →
kubectl get apiservice v1beta1.metrics.k8s.io
kubectl logs -n kube-system deploy/metrics-server
Common log: x509: cannot validate certificate ... doesn't contain any IP SANs.
Fix → Install metrics-server; fix kubelet serving certs (enable serverTLSBootstrap), or as a lab-only workaround add --kubelet-insecure-tls.
Prevent → Remember HPA depends on it; alert on the APIService availability.
More on Kubernetes monitoring and the Prometheus Operator
A new ServiceMonitor is not picked up by the Prometheus OperatorIntermediateServiceMonitor is selected but its targets don't appear on `/targets`IntermediateServiceMonitor target appears but Operator logs `skipping servicemonitor ... failed to get secret`AdvancedPodMonitor targets show `DOWN` with `connection refused` on port 8080 while the app listens on 9090BeginnerPrometheusRule created but rules don't show in PrometheusIntermediate`KubeletDown` / `TargetDown` alerts fire for kube-scheduler and kube-controller-manager on EKS/GKEBeginner