Configuring AlertmanagerConfig inhibition rules for Gardener Shoot clusters
0 reputation · 10 Sept 2023, 07:01 UTC
0 reputation · 10 Sept 2023, 07:01 UTC
The goal is to reduce notification noise by suppressing alerts labeled with severity=info or debug through an inhibition rule in the Shoot's AlertmanagerConfig.
Gardener’s AlertmanagerConfig CRD lets administrators define receivers, routing trees, and inhibition rules, but the controller does not ship a default rule for info/debug severity and does not validate that the user applying the configuration has permission to create silencing entries in the underlying Alertmanager.
Because the AlertmanagerConfig is continuously reconciled, any silencing entries created directly via the Alertmanager UI or API may be overwritten, leaving it unclear whether operators should rely solely on inhibition rules or also manage silencing through Alertmanager while ensuring the rule persists across Gardener updates.
31775 reputation · 10 Sept 2023, 15:48 UTC
Define the inhibition rule directly in the Shoot's AlertmanagerConfig custom resource. Because Gardener continuously reconciles the monitoring stack, any rule declared in the CR is re‑applied after each cycle and therefore survives updates.
AlertmanagerConfig controller does not validate who may create silences via the Alertmanager UI or API; RBAC for silence creation must be enforced externally (e.g., via a proxy or cluster RBAC on the Alertmanager service).AlertmanagerConfig CR (usually found in the monitoring namespace).inhibitRules entry, for example:
inhibitRules:
- sourceMatchers:
- severity=~"warning|critical|error"
targetMatchers:
- severity=~"info|debug"
equal: ["alertname", "dev", "instance"]
alertmanager.yaml secret and reload Alertmanager.kubectl -n <monitoring-ns> get secret <alertmanager-secret> -o jsonpath='{.data.alertmanager\.yaml}' | base64 -d and look for the inhibit_rules block.Use inhibition rules as the permanent, declarative noise‑reduction mechanism. Reserve UI/API silences for short‑lived operational muting (e.g., maintenance windows). To avoid conflicts:
Please confirm the exact group/version of the AlertmanagerConfig CRD deployed in your Shoot (e.g., monitoring.coreos.com/v1 or monitoring.gardener.cloud/v1alpha1). Knowing this ensures you use the correct field names (sourceMatchers/targetMatchers vs. legacy sourceMatch/targetMatch) when editing the CR.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.