diff --git a/control-plane/roles/monitoring/README.md b/control-plane/roles/monitoring/README.md index a44c3fbe3..d75d6f6e3 100644 --- a/control-plane/roles/monitoring/README.md +++ b/control-plane/roles/monitoring/README.md @@ -46,6 +46,8 @@ The following variables can be set to configure the role: | monitoring_slack_notification_icon_url | | The URL of an image that will be used as the icon for notifications in Slack. This is optional, and if not provided, the default icon will be used. The URL must be accessible by Slack and should point to a valid image file. | | monitoring_slack_notification_title | | The title of the Slack notification. This will be used as the headline or subject of the alert and can be a static text or include dynamic content based on the alert data. | | monitoring_slack_notification_text | | The main text body of the Slack notification. This should include the detailed information about the alert and can support Slack's formatting and templating for more structured and readable notifications. | +| monitoring_alertmanager_additional_routes | | Additional [routes](https://prometheus.io/docs/alerting/latest/configuration/#route-related-settings) for the alertmanager. | +| monitoring_alertmanager_additional_receivers | | Additional [receivers](https://prometheus.io/docs/alerting/latest/configuration/#general-receiver-related-settings) for the alertmanager. | | monitoring_metal_api_url | | The URL where to reach metal-api | | monitoring_metal_api_hmac | | The hmac to authenticate against metal-api | | monitoring_thanos_object_store_config | | Object storage used by Thanos, see [Official Documentation](https://thanos.io/tip/thanos/storage.md/#supported-clients) | diff --git a/control-plane/roles/monitoring/defaults/main.yaml b/control-plane/roles/monitoring/defaults/main.yaml index fd303f998..398c18017 100644 --- a/control-plane/roles/monitoring/defaults/main.yaml +++ b/control-plane/roles/monitoring/defaults/main.yaml @@ -40,3 +40,7 @@ monitoring_rethinkdb_exporter_metal_db_endpoint: metal-db.metal-control-plane:28 monitoring_gardener_enabled: "{{ True if monitoring_gardener_seeds | length > 0 else False }}" monitoring_gardener_virtual_garden_kubeconfig: "{{ lookup('k8s', api_version='v1', kind='Secret', namespace='garden', resource_name='garden-kubeconfig-for-admin').get('data', {}).get('kubeconfig') if monitoring_gardener_enabled else None }}" monitoring_gardener_seeds: [] + +# alertmanager config +monitoring_alertmanager_additional_routes: [] +monitoring_alertmanager_additional_receivers: [] diff --git a/control-plane/roles/monitoring/templates/prometheus-stack-values.yaml b/control-plane/roles/monitoring/templates/prometheus-stack-values.yaml index 5439daeeb..5bad021c0 100644 --- a/control-plane/roles/monitoring/templates/prometheus-stack-values.yaml +++ b/control-plane/roles/monitoring/templates/prometheus-stack-values.yaml @@ -150,6 +150,9 @@ alertmanager: repeat_interval: 1h continue: true {% endif %} +{% for route in monitoring_alertmanager_additional_routes %} + - {{ route | to_yaml | indent(width=8, first=false) }} +{% endfor %} receivers: - name: webhook-logger webhook_configs: @@ -181,6 +184,9 @@ alertmanager: url: '{{ template "__alert_silence_link" . }}' {% endraw %} {% endif %} +{% for receiver in monitoring_alertmanager_additional_receivers %} + - {{ receiver | to_yaml | indent(width=6, first=false) }} +{% endfor %} {% raw %} templateFiles: