Setup
- Rancher version: 2.14.0 or newer
- Rancher Monitoring version: 109.0.0+up80.9.1-rancher.5 or newer
- Rancher UI Extensions: none?
- Browser type & version: irrelevant
Describe the bug
Using Rancher 2.14 and the Rancher Monitoring chart 109.0.0, AlertmanagerConfigs can't be created through the UI. This is because the Rancher Monitoring chart now includes a ValidatingWebhook to validate AlertmanagerConfigs and the YAML generated by the UI is not valid.
To Reproduce
- Install Rancher Monitoring version 109.0.0 or newer
- Go to Monitoring > Alerting > AlertmanagerConfigs and click Create
- Set a name and click Create
Result
You will get the following error:
admission webhook "alertmanagerconfigsvalidate.monitoring.coreos.com" denied the request: AlertmanagerConfig is invalid
Expected Result
The AlertmanagerConfig should be created.
Screenshots

Additional context
As mentioned before, this is now an issue because AlertmanagerConfigs are now validated by a ValidatingWebhook.
There's two issues with the YAML that the UI generates:
apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
name: test
namespace: cattle-monitoring-system
spec:
receivers:
route:
groupInterval: 5m
groupWait: 30s
repeatInterval: 4h
match:
{}
matchRe:
{}
spec.route.match and spec.route.matchRe do not exist in the CRD and should not be there
- The route must define a receiver under
spec.route.receiver and it must exist in spec.receivers, but the UI does not allow you to create a Receiver until the AlertmanagerConfig is created (the button to create a Receiver is disabled).
Both can be checked by applying the YAML manually via the console:
Error from server (BadRequest): error when creating "amc.yaml": AlertmanagerConfig in version "v1alpha1" cannot be handled as a AlertmanagerConfig: strict decoding error: unknown field "spec.route.match", unknown field "spec.route.matchRe"
Then if you remove those fields:
The "alertmanagerconfigs" is invalid: : root route must define a receiver
And after setting spec.route.receiver:
The "alertmanagerconfigs" is invalid: : receiver "test" not found
Example of a silly but valid YAML. spec.route.match and spec.route.matchRe are not present and the route references (spec.route.receiver) an existing receiver in spec.receivers.
apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
name: test
namespace: cattle-monitoring-system
spec:
receivers:
- name: test
route:
groupInterval: 5m
groupWait: 30s
repeatInterval: 4h
receiver: test
Setup
Describe the bug
Using Rancher 2.14 and the Rancher Monitoring chart 109.0.0, AlertmanagerConfigs can't be created through the UI. This is because the Rancher Monitoring chart now includes a ValidatingWebhook to validate AlertmanagerConfigs and the YAML generated by the UI is not valid.
To Reproduce
Result
You will get the following error:
Expected Result
The AlertmanagerConfig should be created.
Screenshots

Additional context
As mentioned before, this is now an issue because AlertmanagerConfigs are now validated by a ValidatingWebhook.
There's two issues with the YAML that the UI generates:
spec.route.matchandspec.route.matchRedo not exist in the CRD and should not be therespec.route.receiverand it must exist inspec.receivers, but the UI does not allow you to create a Receiver until the AlertmanagerConfig is created (the button to create a Receiver is disabled).Both can be checked by applying the YAML manually via the console:
Then if you remove those fields:
And after setting
spec.route.receiver:Example of a silly but valid YAML.
spec.route.matchandspec.route.matchReare not present and the route references (spec.route.receiver) an existing receiver inspec.receivers.