spec section is straightforward. You define the route—including parameters such as groupBy, groupWait, groupInterval, and repeatInterval—and then list your receivers. This mirrors the setup of a regular Alertmanager rule.
When you execute:you may notice that the
alertmanagerConfigSelector property is empty. This selector helps Alertmanager discover AlertManagerConfig objects in your cluster. By default, the Helm chart does not set any label for this selector. To resolve this, update the Helm chart to include a label that matches the one specified in your AlertManagerConfig (in this case, resource: prometheus).Standard Alertmanager Configuration vs. AlertManagerConfig CRD
When comparing the traditional Alertmanager configuration file (commonly outside of Kubernetes) with the AlertManagerConfig CRD format, you will observe some differences:Standard Alertmanager YAML (snake_case)
AlertManagerConfig YAML (camelCase)
name and value fields instead of using a simple key-value pair.
Updating the Helm Chart
To enable the selector for your AlertManagerConfig, update your Helm chart configuration as follows:-
First, retrieve the current values and save them to a file:
-
Locate and update the
alertmanagerConfigSelectorproperty in yourvalues.yamlfile: -
Save the changes and upgrade your Helm release:
Verifying the CRD and Update
To inspect the CustomResourceDefinitions (CRDs) for Alertmanager, run:alertmanagerconfigs.monitoring.coreos.com and alertmanagers.monitoring.coreos.com. Then, verify that the Alertmanager configuration now includes your selector by running:
alertmanagerConfigSelector property populated with the matching label.
Creating and Verifying an AlertManagerConfig
After updating your Helm chart, create a new AlertManagerConfig file. For example, save the configuration below asalert.yaml:
Accessing and Verifying Alertmanager
To confirm that your configuration is active, set up port forwarding to the Alertmanager service:alert-config webhook along with other configuration details, such as: