Blog

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

16.07.2024
Reading time: 2 mins.
Last Updated: 04.03.2025

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
MS Teams Alerts for Kubernetes Cluster: Setting Up Alertmanager with Prometheus-MSTeams Helm Chart -Status of deployment
kubectl get pods -n monitoring
MS Teams Alerts for Kubernetes Cluster: Setting Up Alertmanager with Prometheus-MSTeams Helm Chart - status of the pods
kubectl get svc -n monitoring
MS Teams Alerts for Kubernetes Cluster: Setting Up Alertmanager with Prometheus-MSTeams Helm Chart - status of the services

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

MS Teams Alerts for Kubernetes Cluster: Setting Up Alertmanager with Prometheus-MSTeams Helm Chart - create a chennel
MS Teams Alerts for Kubernetes Cluster: Setting Up Alertmanager with Prometheus-MSTeams Helm Chart -monitoring team

Copy the URL and save it.

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

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

kubectl edit cm prometheus-msteams-config -n monitoring

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

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

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

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.

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

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

Explore how Kubernetes is evolving to support AI and ML at scale—covering multi-cluster orchestration, GPU optimization, observability. Kubecon 2025
Reading
Day 2 at KubeCon 2025 delved deep into the many facets of cloud-native security, illustrating how practitioners apply zero-trust principles, integrate policy-as-code, secure AI workloads, and harden Kubernetes clusters in...
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.