Blog

MS Teams Alerts for Kubernetes Cluster: Setting Up Alertmanager with Prometheus-MSTeams Helm Chart

16.07.2024
Reading time: 2 mins.
Last Updated: 16.07.2024

Table of Contents

Integrating Alertmanager with Microsoft Teams enables you to receive alerts directly in Teams channels, facilitating swift collaboration with your team to address issues promptly. This guide will use Prometheus-MSTeams, a lightweight Go Web Server designed to bridge the gap between Prometheus Alertmanager and Microsoft Teams.

Alertmanager by itself cannot format notifications correctly for the Microsoft Teams webhook. This limitation necessitates the use of Prometheus-MSTeams, which converts the POST alert messages from Prometheus Alertmanager into a format compatible with Teams. In our setup, we will deploy Prometheus-MSTeams using a Helm chart in Kubernetes, ensuring a seamless integration and efficient alert management within your Kubernetes cluster.

helm repo add prometheus-msteams https://prometheus-msteams.github.io/prometheus-msteams/
helm upgrade --install msteams prometheus-msteams/prometheus-msteams -n monitoring

After the installation, it’s crucial to verify that the pods and deployment are running correctly. You can do this by executing the following commands:

kubectl get deployments -n monitoring
kubectl get pods -n monitoring
kubectl get svc -n monitoring

To configure the new channel, simply navigate to “Connectors,” add an “Incoming Webhook,” and specify a name of your choice.

Copy the URL and save it.

We need to edit the ConfigMap for Prometheus-MSTeams Configuration:

kubectl edit cm prometheus-msteams-config -n monitoring

In this step, we configure a new connector named “alertmanager-teams” in Prometheus-MSTeams, using the incoming webhook URL previously created in Microsoft Teams.

http://prometheus-msteams: This is the hostname of the Prometheus-MSTeams service in your Kubernetes cluster, assuming it’s accessible via the service name prometheus-msteams.

:2000: This is the port number where Prometheus-MSTeams listens for incoming alerts, configured here as port 2000.

alertmanager-teams: This path represents the name of the connector (endpoint) in Prometheus-MSTeams where it expects to receive alerts from.

After configuring Alertmanager with the new connector as a receiver, it is important to verify that alerts are properly being sent to your Microsoft Teams channel.

Integrating Alertmanager with Microsoft Teams through Prometheus-MSTeams ensures that alerts are formatted correctly and delivered efficiently to your Teams channels. This integration enhances your team’s ability to respond to issues promptly within your Kubernetes cluster.

Leave a Reply

Your email address will not be published. Required fields are marked *

More Posts

What is AWS AppStream 2.0 AWS AppStream 2.0 is a service that lets you run desktop applications in the cloud, so users can access them from anywhere, without having to...
Reading
Managing Terraform locals efficiently is crucial for creating clean, maintainable, and reusable configurations. This guide will cover what Terraform locals are, how to implement them, and best practices for their...
Reading
Get In Touch
ITGix provides you with expert consultancy and tailored DevOps services to accelerate your business growth.
Newsletter for
Tech Experts
Join 12,000+ business leaders and engineers who receive blogs, e-Books, and case studies on emerging technology.