// This assembly is included in the following assemblies:
//
// metrics/assembly_metrics-prometheus-setup.adoc

[id='proc-metrics-deploying-prometheus-alertmanager-{context}']

= Deploying Alertmanager

[role="_abstract"]
Use Alertmanager to route alerts to a notification service.
link:https://prometheus.io/docs/alerting/alertmanager/[Prometheus Alertmanager^] is a component for handling alerts and routing them to a notification service.
Alertmanager supports an essential aspect of monitoring, which is to be notified of conditions that indicate potential issues based on alerting rules.

You can use the xref:assembly-metrics-config-files-{context}[example metrics configuration files] provided by Strimzi to deploy Alertmanager to send notifications to a Slack channel.
A configuration file defines the resources for deploying Alertmanager:

* `examples/metrics/prometheus-install/alert-manager.yaml`

An additional configuration file provides the hook definitions for sending notifications from your Kafka cluster:

* `examples/metrics/prometheus-alertmanager-config/alert-manager-config.yaml`

The following resources are defined on deployment:

* An `Alertmanager` to manage the Alertmanager pod.
* A `Secret` to manage the configuration of the Alertmanager.
* A `Service` to provide an easy to reference hostname for other services to connect to Alertmanager (such as Prometheus).

.Prerequisites
* xref:proc-metrics-kafka-deploy-options-{context}[Metrics are configured for the Kafka cluster resource]
* xref:assembly-metrics-prometheus-{context}[Prometheus is deployed]

.Procedure

. Update the `alert-manager-config.yaml` file in the `examples/metrics/prometheus-alertmanager-config` directory to replace the following:
+
* `slack_api_url` property with the actual value of the Slack API URL related to the application for the Slack workspace
* `channel` property with the actual Slack channel on which to send notifications

. Create a `Secret` resource from the Alertmanager configuration file:
+
[source,shell,subs="+quotes,attributes"]
kubectl apply -f alert-manager-config.yaml

. Deploy Alertmanager:
+
[source,shell,subs="+quotes,attributes"]
kubectl apply -f alert-manager.yaml
