Interview Prep/Monitoring & Observability/Alerting and Alertmanager

`AlertmanagerConfig` CR in a namespace has no effect

AdvancedTroubleshootingAlerting and Alertmanager
Answer

Likely causes → The Alertmanager CR's alertmanagerConfigSelector / alertmanagerConfigNamespaceSelector does not match the CR, or the Operator rejected it as invalid.

Diagnose →

kubectl get alertmanager -n monitoring -o yaml | grep -A5 alertmanagerConfig
kubectl logs -n monitoring deploy/prometheus-operator | grep -i alertmanagerconfig
kubectl get secret alertmanager-main-generated -n monitoring -o jsonpath='{.data.alertmanager\.yaml\.gz}' | base64 -d | gunzip | less

Fix → Label the CR to match the selector. Remember the Operator adds a namespace matcher to every route in that CR, so alerts must carry the matching namespace label.

Prevent → Document the required labels for team-owned AlertmanagerConfigs.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Alerting and Alertmanager