# Configure Notifications for Kubernetes

With the PortSIP UCaaS, its support send the alert notifications.

## Alert notifications <a href="#alert-notifications" id="alert-notifications"></a>

When an alert changes state, it sends out notifications. Each alert rule can have multiple notifications. In order to add a notification to an alert rule you first need to add and configure a `notification` channel (can be email, PagerDuty, or other integration).

This is done from the Notification channels page.

## List of supported notifiers <a href="#list-of-supported-notifiers" id="list-of-supported-notifiers"></a>

| Name                                                                                                       | Type                      | Supports images    | Support alert rule tags |
| ---------------------------------------------------------------------------------------------------------- | ------------------------- | ------------------ | ----------------------- |
| [DingDing](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#dingdingdingtalk)                 | `dingding`                | yes, external only | no                      |
| Discord                                                                                                    | `discord`                 | yes                | no                      |
| [Email](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#email)                               | `email`                   | yes                | no                      |
| [Google Hangouts Chat](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#google-hangouts-chat) | `googlechat`              | yes, external only | no                      |
| Hipchat                                                                                                    | `hipchat`                 | yes, external only | no                      |
| [Kafka](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#kafka)                               | `kafka`                   | yes, external only | no                      |
| Line                                                                                                       | `line`                    | yes, external only | no                      |
| Microsoft Teams                                                                                            | `teams`                   | yes, external only | no                      |
| [Opsgenie](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#opsgenie)                         | `opsgenie`                | yes, external only | yes                     |
| [Pagerduty](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#pagerduty)                       | `pagerduty`               | yes, external only | yes                     |
| Prometheus Alertmanager                                                                                    | `prometheus-alertmanager` | yes, external only | yes                     |
| [Pushover](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#pushover)                         | `pushover`                | yes                | no                      |
| Sensu                                                                                                      | `sensu`                   | yes, external only | no                      |
| [Sensu Go](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#sensu-go)                         | `sensugo`                 | yes, external only | no                      |
| [Slack](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#slack)                               | `slack`                   | yes                | no                      |
| Telegram                                                                                                   | `telegram`                | yes                | no                      |
| Threema                                                                                                    | `threema`                 | yes, external only | no                      |
| VictorOps                                                                                                  | `victorops`               | yes, external only | yes                     |
| [Webhook](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#webhook)                           | `webhook`                 | yes, external only | yes                     |
| [Zenduty](https://grafana.com/docs/grafana/v7.5/alerting/notifications/#zenduty)                           | `webhook`                 | yes, external only | yes                     |

\
Configure EMAIL Notifications
-----------------------------

### SMTP settings

On the Pod of `k8s-master-01`, edit `/root/prometheus/values.yaml` file, edit it as the below (You will need to replace the information by your actual SMTP settings):

```
650     smtp:
651       enabled: true
652       host: smtp.example.com:465
653       user: test
654       password: testtest
655       skip_verify: true
656       from_address: test@example.com
657       from_name: test
```

On the Pod of `k8s-master-01`, perform the below command:

```
cd /root/prometheus && helm upgrade --install prometheus ./ -f values.yaml
```

### Configure Alerting

#### **Add Notification Channels**

1. Sign in the Grafana, go to **`Alerting -> Notification channels`**

![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FllhjObRRT8gFx6UCrU06%2Fgrafana-1.png?alt=media\&token=234ea539-3dd6-451b-8953-dde0c03729da)

2\. Click the "**Add channel**" button, you can enter the emails which will be alerted in the "**Addresses**" field.

![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FE2iLv6vOVGMKUe0KaVSy%2Fgrafana-2.png?alt=media\&token=5f018fae-12b3-4775-b0da-8c5ba8771cb5)

3\. Test. After clicking the "**Test**" button, will popups "**Test Notification sent**" information. All emails of the "**Addresses**" filed will receive the email.

![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FeooDBolyRd5iP3F1Vg05%2Fgrafana-3.png?alt=media\&token=86e58f85-5403-4395-8492-07df0bd77f8a)

#### Alert Rules

1. Create a new dashboard. **`Create > Import.`**

![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2F5TXjwObnQR1gLZAi1nrO%2Fgrafana-4.png?alt=media\&token=f85af650-3b34-45ab-85d0-ffbb59ec6131)

In this example，we import the dashboard from `grafana.com`，in the production environment you will need to create your own custom`Dashboard.`

![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2F6bpwoLLGmqvyHrmgohcM%2Fgrafana-5.png?alt=media\&token=55f037c0-9167-4e74-bd47-f2bebad58f61) ![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2Fo1yzgLQ6ZNHctCp9gbmk%2Fgrafana-6.png?alt=media\&token=ef82ab9f-391a-4bf9-8f94-b979602c84c1)

3\. Save the dashboard after successfully importing.

![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FZwDwXTCvRFBueb7CPSdR%2Fgrafana-7.png?alt=media\&token=c1403b3b-c520-4b06-96fe-b6b1b703b2ee) ![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FzRCWIe2Z4Kd4ucMYwE34%2Fgrafana-8.png?alt=media\&token=74b55238-78a3-4783-91ff-70af33553824)

4\. Check Alert rule

As the below example, there have three rules.

![](https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FCFjkkZWKF3LoVFghiEAE%2Fgrafana-9.png?alt=media\&token=772cdd21-f195-4f52-83d1-6956c04d9b03)
