Interview Prep/Monitoring & Observability/Kubernetes monitoring and the Prometheus Operator

kube-state-metrics series are missing for a new CRD-based resource

IntermediateTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer

Likely causes → kube-state-metrics only exposes built-in resources by default; custom resources need --custom-resource-state-config.

Diagnose → curl ksm:8080/metrics | grep -i <crd> returns nothing.

Fix → Provide a CustomResourceStateMetrics config describing which fields to expose, and grant RBAC to list/watch the CRD.

Prevent → Prefer the operator's own metrics endpoint for its CRDs where available.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Kubernetes monitoring and the Prometheus Operator