The VMAlertmanagerConfig provides way to configure VMAlertmanager
configuration with CRD. It allows to define different configuration parts, which will be merged by operator into config.
It behaves like other config parts - VMServiceScrape and etc.
The operator performs validation of VMAlertmanagerConfig. In case of any misconfiguration it adds corresponding validation fail message into status.lastSyncError field and updates status.status field to failed status.
For example VMAlertmanagerConfig without required fields:
apiVersion:operator.victoriametrics.com/v1beta1kind:VMAlertmanagerConfigmetadata:name:invalid-confignamespace:defaultspec:receivers:- name:blackhole- name:pagerdutypagerduty_configs:- url:http://exampleroute:group_by:- alertnamereceiver:blackholeroutes:- matchers:- alertname="pd"receiver:pagerdutystatus:lastErrorParentAlertmanagerName:default/example-alertmanagerlastSyncError: 'receiver at idx=2 is invalid:at idx=0 pagerduty_configs one of''routing_key'' or ''service_key'' must be configured'lastSyncErrorTimestamp:1722950290status:failed
VMAlertmanagerConfig allows delegating notification configuration to the kubernetes cluster users.
The application owner may configure notifications by defining it at VMAlertmanagerConfig.
With the combination of VMRule and VMServiceScrape it allows delegating configuration observability to application owners, and uses popular GitOps practice.
Operator combines VMAlertmanagerConfigs into a single configuration file for VMAlertmanager.
VMAlertmanagerConfig has enforced namespace matcher.
Alerts must have a proper namespace label, with the same value as name of namespace for VMAlertmanagerConfig.
It can be disabled, by setting the following value to the VMAlertmanager: spec.disableNamespaceMatcher: true.