Notifiers and alerts are two features that work together to inform you of events in the Rancher system. Notifiers are objects that you configure to leverage popular IT services, which send you notification of Rancher events. Alerts are rule sets that trigger when those notifications are sent.

Notifiers and alerts are built on top of the Prometheus Alertmanager. Leveraging these tools, Rancher can notify cluster owners and project owners of events they need to address.

Notifiers

Before you can receive alerts, you must configure one or more notifier in Rancher.

Notifiers are services that inform you of alert events. You can configure notifiers to send alert notifications to staff best suited to take corrective action.

Notifiers are configured at the cluster level. This model ensures that only cluster owners need to configure notifiers, leaving project owners to simply configure alerts in the scope of their projects. You don’t need to dispense privileges like SMTP server access or cloud account access.

Rancher integrates with a variety of popular IT services, including:

  • Slack: Send alert notifications to your Slack channels.
  • Email: Choose email recipients for alert notifications.
  • PagerDuty: Route notifications to staff by phone, SMS, or personal email.
  • WebHooks: Update a webpage with alert notifications.

Adding Notifiers

Set up a notifier so that you can begin configuring and sending alerts.

  1. From the Global View, open the cluster that you want to add a notifier to.

  2. From the main menu, select Tools > Notifiers. Then click Add Notifier.

  3. Select the service you want to use as your notifier, and then fill out the form.

    1. Enter a Name for the notifier.
    2. From Slack, create a webhook. For instructions, see the Slack Documentation.
    3. From Rancher, enter your Slack webhook URL.
    4. Enter the name of the channel that you want to send alert notifications in the following format: #<channelname>.

      Both public and private channels are supported.

    5. Click Test. If the test is successful, the Slack channel you’re configuring for the notifier outputs Slack setting validated.

    1. Enter a Name for the notifier.
    2. In the Sender field, enter an email address available on your mail server that you want to send the notification.
    3. In the Host field, enter the IP address or host name for your SMTP server. Example: smtp.email.com
    4. In the Port field, enter the port used for email. Typically, TLS uses 587 and SSL uses 465. If you’re using TLS, make sure Use TLS is selected.
    5. Enter a Username and Password that authenticate with the SMTP server.
    6. In the Default Recipient field, enter the email address that you want to receive the notification.
    7. Click Test. If the test is successful, Rancher prints settings validated and you receive a test notification email.
    1. Enter a Name for the notifier.
    2. From PagerDuty, create a webhook. For instructions, see the PagerDuty Documentation.
    3. From PagerDuty, copy the webhook’s Integration Key.
    4. From Rancher, enter the key in the Service Key field.
    5. Click Test. If the test is successful, your PagerDuty endpoint outputs PageDuty setting validated.
    1. Enter a Name for the notifier.
    2. Using the app of your choice, create a webhook URL.
    3. Enter your webhook URL.
    4. Click Test. If the test is successful, the URL you’re configuring as a notifier outputs Webhook setting validated.

  4. Click Add to complete adding the notifier.

Result: Your notifier is added to Rancher.

What’s Next?

After creating a notifier, set up alerts to receive notifications of Rancher system events.

Managing Notifiers

After you set up notifiers, you can manage them by selecting Tools > Notifiers from the Global view. You can:

  • Edit their settings that you configured during their initial setup.
  • Clone them, to quickly setup slightly different notifiers.
  • Delete them when they’re no longer necessary.

Alerts

To keep your clusters and applications healthy and driving your organizational productivity forward, you need to stay informed of events occurring in your clusters and projects, both planned and unplanned. To help you stay informed of these events, you can configure alerts.

Alerts are sets of rules, chosen by you, to monitor for specific events. The scope for alerts can be set at either the cluster or project level.

Cluster Alerts vs. Project Alerts

At the cluster level, Rancher monitors components in your Kubernetes cluster, and sends you alerts related to:

  • The state of your nodes.
  • The system services that manage your Kubernetes cluster.
  • The resource events from specific system services.

At the project level, Rancher monitors specific deployments and sends alerts for:

  • Deployment availability
  • Workloads status
  • Pod status

Adding Cluster Alerts

As a cluster owner, you can configure Rancher to send you alerts for cluster events.

Prerequisite: Before you can receive cluster alerts, you must add a notifier.

  1. From the Global view, open the cluster that you want to configure alerts for.

  2. From the main menu, select Tools > Alerts. Then click Add Alert.

  3. Enter a Name for the alert that describes its purpose.

  4. Based on the type of alert you want to create, complete one of the instruction subsets below.

    This alert type monitors for events that affect one of the Kubernetes master components, regardless of the node it occurs on.

    1. Select the System Services option, and then select an option from the drop-down.

    2. Select the urgency level of the of alert. The options are:

      • Critical: Most urgent
      • Warning: Normal urgency
      • Info: Least urgent

        Select the urgency level based on the importance of the service and how many nodes fill the role within your cluster. For example, if you’re making an alert for the etcd service, select Critical. If you’re making an alert for redundant schedulers, Warning is more appropriate.

    This alert type monitors for specific events that are thrown from a resource type.

    1. Choose the type of resource event that triggers an alert. The options are:

      • Normal: triggers an alert when any standard resource event occurs.
      • Warning: triggers an alert when unexpected resource events occur.
    2. Select a resource type from the Choose a Resource drop-down that you want to trigger an alert.

    3. Select the urgency level of the of alert.

      • Critical: Most urgent
      • Warning: Normal urgency
      • Info: Least urgent

        Select the urgency level of the alert by considering factors such as how often the event occurs or its importance. For example:

      • If you set a normal alert for pods, you’re likely to receive alerts often, and individual pods usually self-heal, so select an urgency of Info.

      • If you set a warning alert for StatefulSets, its very likely to impact operations, so select an urgency of Critical.

    This alert type monitors for events that occur on a specific node.

    1. Select the Node option, and then make a selection from the Choose a Node drop-down.

    2. Choose an event to trigger the alert.

      • Not Ready: Sends you an alert when the node is unresponsive.
      • CPU usage over: Sends you an alert when the node raises above an entered percentage of its processing allocation.
      • Mem usuage over: Sends you an alert when the node raises above an entered percentage of its memory allocation.
    3. Select the urgency level of the of alert.

      • Critical: Most urgent
      • Warning: Normal urgency
      • Info: Least urgent

        Select the urgency level of the alert based on its impact on operations. For example, an alert triggered when a node’s CPU raises above 60% deems a urgency of Info, but a node that is Not Ready deems an urgency of Critical.

    This alert type monitors for events that occur on any node on marked with a label. For more information, see the Kubernetes documentation for Labels.

    1. Select the Node Selector option, and then click Add Selector to enter a key value pair for a label. This label should be applied to one or more of your nodes. Add as many selectors as you’d like.

    2. Choose an event to trigger the alert.

      • Not Ready: Sends you an alert when selected nodes are unresponsive.
      • CPU usage over: Sends you an alert when selected nodes raise above an entered percentage of processing allocation.
      • Mem usuage over: Sends you an alert when selected nodes raise above an entered percentage of memory allocation.
    3. Select the urgency level of the of alert.

      • Critical: Most urgent
      • Warning: Normal urgency
      • Info: Least urgent

        Select the urgency level of the alert based on its impact on operations. For example, an alert triggered when a node’s CPU raises above 60% deems a urgency of Info, but a node that is Not Ready deems an urgency of Critical.

  5. Finally, choose the notifiers that send you alerts.

    • You can set up multiple notifiers.
    • You can change notifier recipients on the fly.

Result: Your alert is configured. A notification is sent when the alert is triggered.

Managing Cluster Alerts

After you set up cluster alerts, you can manage each alert object. To manage alerts, browse to the cluster containing the alerts, and then select Tools > Alerts that you want to manage. You can:

  • Deactivate/Reactive alerts
  • Edit alert settings
  • Delete unnecessary alerts

Adding Project Alerts

Prerequisite: Before you can receive project alerts, you must add a notifier.

  1. From the Global view, open the project that you want to configure alerts for.

  2. From the main menu, select Resources > Alerts. Then click Add Alert.

  3. Enter a Name for the alert that describes its purpose.

  4. Based on the type of alert you want to create, complete one of the instruction subsets below.

    This alert type monitors for the status of a specific pod.

    1. Select the Pod option, and then select a pod from the drop-down.
    2. Select a pod status that triggers and alert:

      • Not Running
      • Not Scheduled
      • Restarted <x> times with the last <x> Minutes
    3. Select the urgency level of the of alert. The options are:

      • Critical: Most urgent
      • Warning: Normal urgency
      • Info: Least urgent

      Select the urgency level of the alert based on pod state and expendability. For example, an stateless pod that’s not can be easily replaced, so select Info. However, if an important pod isn’t scheduled, it may affect operations, so choose Critical.

    This alert type monitors for the availability of a workload.

    1. Choose the Workload option. Then choose a workload from the drop-down.

    2. Choose an availability percentage using the slider. The alert is triggered when the workload’s availability on your cluster nodes drops below the set percentage.

    3. Select the urgency level of the of alert.

      • Critical: Most urgent
      • Warning: Normal urgency
      • Info: Least urgent

      Select the urgency level of the alert based on the percentage you choose and the importance of the workload.

    This alert type monitors for the availability of all workloads marked with tags that you’ve specified.

    1. Select the Workload Selector option, and then click Add Selector to enter the key value pair for a label. If one of the workloads drops below your specifications, an alert is triggered. This label should be applied to one or more of your workloads.

    2. Select the urgency level of the of alert.

      • Critical: Most urgent
      • Warning: Normal urgency
      • Info: Least urgent

      Select the urgency level of the alert based on the percentage you choose and the importance of the workload.

  5. Finally, choose the notifiers that send you alerts.

    • You can set up multiple notifiers.
    • You can change notifier recipients on the fly.

Result: Your alert is configured. A notification is sent when the alert is triggered.

Managing Project Alerts

To manage project alerts, browse to the project that alerts you want to manage. Then select Resources > Alerts. You can:

  • Deactivate/Reactive alerts
  • Edit alert settings
  • Delete unnecessary alerts