Intro into Rancher notifiers and how to use them with alerts.
Happy Friday everyone! Thanks for joining me today for 5 minute Friday and let’s get into checking out some tech. Today we are going to go through Rancher notifiers and how to use them with alerts.
Documentation on Rancher notifiers: https://rancher.com/docs/rancher/v2.x/en/cluster-admin/tools/notifiers/
What are Rancher notifiers? Rancher notifiers are services that you can use in conjunction with alertmanager (prometheus for metrics) to get notifications about alerts, or errors, or status of most anything running in rancher. Rancher supports a wide range of notifier integrations out of the box.
- Slack
- PagerDuty
- Webhooks
- DingTalk
- Microsoft Teams
Notifiers are managed at the cluster level. This makes sure that only cluster admins need to add the notifiers. Letting your developers or rancher users to only have to configure the alerts at the project and namespace level.
Notifiers are configured in Rancher from the global view, and then by selecting the cluster you want to add notifiers to. From the tools menu select notifiers.
Or you can add them with terraform of course https://registry.terraform.io/providers/rancher/rancher2/latest/docs/resources/notifier
In the notifier view, click add notifier in the top right hand corner. You will be presented with a screen to choose your integration you want to setup (or multiple).
On each of the choices there will be a link to a guide at the bottom to help you get them setup correctly. You will have the option to also send resolved alerts, along with a test button to make sure your integration is working. Once you have it all setup and tested hit save.
Great you now have your first notifier setup and ready to use. Now how do we use it? These notifiers work with the built in Rancher alerts (alert manager) and can be setup up on a cluster and/or project level.
If you click back over to the cluster, and then from the tools menu select alerts. You can select edit on any of the alert groups to add your notifier to it. You can also create your own alert rules in here.
Scroll to the bottom of the alert rules, and you will see where you can add your notifier to be used. Select it and hit save.
That’s it! You now have configured alerts in rancher to use your notifier. As a reminder you set alerts up on not only the cluster level, but also the project level inside rancher. And in addition to that notifiers can be used in Rancher pipelines (https://www.opsmonkeys.com/2020/09/11/intro-to-rancher-2-ci-cd-pipelines/).
If we take a look at some previous alerts I have gotten in slack they look like this and are quite helpful indeed. Wether you send them to slack, or to pagerduty for production impacting errors, Rancher notifiers are a great little integration to use.
Thanks all for following along for this 5 min Friday intro to Rancher notifiers and hope you all have a great weekend.