Prometheus pod logs `forbidden: User "system:serviceaccount:monitoring:prometheus-k8s" cannot list resource "endpoints" in API group "" in the namespace "shop"`
IntermediateTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer
Likely causes → The Operator namespaced RBAC doesn't include the new namespace (kube-prometheus creates Roles per listed namespace).
Diagnose →
kubectl auth can-i list endpoints -n shop --as=system:serviceaccount:monitoring:prometheus-k8s
Fix → Add a Role/RoleBinding in shop, or use a ClusterRole for cluster-wide discovery.
Prevent → Include the monitoring Role in namespace onboarding.
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