kube-state-metrics pod OOMKilled in a large cluster
AdvancedTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer
Likely causes → Thousands of objects × all resources × all labels (--metric-labels-allowlist=pods=[*]) in one replica.
Diagnose → kubectl top pod -n monitoring -l app.kubernetes.io/name=kube-state-metrics; check series count by job="kube-state-metrics".
Fix → Restrict --resources, narrow --metric-labels-allowlist, and shard horizontally (--shard/--total-shards, or StatefulSet auto-sharding).
Prevent → Track KSM series per resource type.
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