`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.
More on Alerting and Alertmanager
An alert shows `Pending` in Prometheus but never goes to `Firing`BeginnerAn alert is `Firing` in Prometheus but nothing reaches AlertmanagerIntermediateAlertmanager shows the alert but Slack receives nothingBeginnerAlertmanager logs `notify retry canceled due to unrecoverable error after 1 attempts: channel_not_found`IntermediateAlertmanager logs `unexpected status code 404: no_service` / `invalid_token` for SlackBeginnerAlertmanager fails to load config: `yaml: unmarshal errors: field matchers not found in type config.plain`Intermediate