Course contentsShow
← Cloud and Infrastructure
Lesson 1928 of 2,98941. FluxFree lesson

Flux Notifications and Alerts

Set up notifications for reconciliation events using Provider and Alert resources to Slack, Teams, or webhooks.

Flux Notifications and Alerts

What you'll learn: How to configure Flux to send real-time notifications about reconciliation events to Slack, Teams, or webhooks using Provider and Alert resources.

Why Notifications Matter in GitOps

When Flux reconciles your cluster state with Git, you want to know what's happening—especially when deployments succeed, fail, or drift is detected. Without visibility, you're flying blind. Flux's notification system acts like a messenger that taps you on the shoulder whenever something important occurs.

The Two-Resource Pattern

Flux uses two Kubernetes resources to deliver notifications:

Provider — defines where notifications go (Slack, Microsoft Teams, webhook endpoints, etc.). Think of this as configuring your messenger's delivery address.

Alert — defines what events trigger notifications and which Flux resources to watch (like specific Kustomizations or HelmReleases). This is your filter: "Tell me when this deployment changes status."

How It Works

First, you create a Provider resource specifying your notification channel:

apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Provider
metadata:
  name: slack-bot
  namespace: flux-system
spec:
  type: slack
  address: https://hooks.slack.com/services/YOUR/WEBHOOK/URL

Then create an Alert that references the Provider and watches specific resources:

apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Alert
metadata:
  name: prod-alerts
  namespace: flux-system
spec:
  providerRef:
    name: slack-bot
  eventSeverity: info
  eventSources:
    - kind: Kustomization
      name: my-app

Now whenever my-app reconciles, fails, or recovers, you'll get a Slack message immediately.

Common Use Cases

  • Alert on deployment failures for rapid response
  • Notify on successful production deployments
  • Track drift detection events
  • Monitor Helm release upgrades

Key Takeaway: Flux Notifications use Provider resources to define communication channels and Alert resources to filter which reconciliation events trigger messages, giving you real-time visibility into your GitOps operations.