MS TeamsΒΆ

Robusta can report issues and events in your Kubernetes cluster to a MS Teams webhook.

To configure a MS Teams sink we need a webhook URL for the target teams channel. You can configure it in MS Teams channel connectors.

Configuring the MS Teams sinkΒΆ

Add this to your generated_values.yaml

sinksConfig:
- ms_teams_sink:
    name: main_ms_teams_sink
    webhook_url: teams-incoming-webhook  # see instructions below
    webhook_override: DYNAMIC MS TEAMS WEBHOOK URL OVERRIDE (Optional)

Then do a Helm Upgrade.

Obtaining a webhook URLΒΆ

  • Choose a channel and click "Manage Channel".

  • Click "Connectors->Edit", and configure an "Incoming Webhook"

  • Fill out the name robusta.

  • Optional: upload the robusta logo for the connector’s image.

  • Copy the webhook_url.

Dynamically Route MS Teams AlertsΒΆ

You can set the MS Teams webhook url value dynamically, based on the value of a specific annotation and environmental variable passed to runner.

This can be done using the optional webhook_override sink parameter.

As for now, the webhook_override parameter supports retrieving values specifically from annotations. You can specify an annotation key to retrieve the MS Teams webhook URL using the format annotations.<annotation_key>. For example, if you use annotations.ms-team-alerts-sink, the webhook URL will be taken from an annotation with the key ms-team-alerts-sink.

If the specified annotation does not exist, the default webhook URL from the webhook_url parameter will be used. If the annotation exists but does not contain a URL, the system will look for an environmental variable with the name matching the annotation value.

 sinksConfig:
 # MS Teams integration params
- ms_teams_sink:
    name: main_ms_teams_sink
    webhook_url: teams-incoming-webhook  # see instructions below
    webhook_override: "annotations.ms-team-alerts-sink"

A replacement pattern is also allowed, using $ sign, before the variable. For cases where labels or annotations include special characters, such as ${annotations.kubernetes.io/service-name}, you can use the ${} replacement pattern to represent the entire key, including special characters. For example, if you want to dynamically set the MS Teams webhook url based on the annotation kubernetes.io/service-name, you can use the following syntax:

  • webhook_override: "${annotations.kubernetes.io/service-name}"

Example:

sinksConfig:
- ms_teams_sink:
    name: main_ms_teams_sink
    webhook_url: teams-incoming-webhook  # see instructions below
    webhook_override: ${annotations.kubernetes.io/service-name}