Skip to content

Webhook Notifications

VolumeBackup and S3Backup resources support webhook notifications on backup success or failure. The operator sends an HTTP POST with a JSON payload to the configured URLs.

Configuration

apiVersion: backups.k8s.bnerd.com/v1
kind: VolumeBackup
metadata:
  name: my-backup
spec:
  # ... backup configuration ...

  webhooks:
    success: "https://hooks.example.com/backup-success"
    failure: "https://hooks.example.com/backup-failure"

Both fields are optional. You can configure only success, only failure, or both.

Payload Format

The operator sends a JSON POST request on each backup completion:

Success Payload

{
  "status": "success",
  "message": "Volume backup completed",
  "host": "default-my-data-pvc",
  "volume": "my-data-pvc"
}

Failure Payload

{
  "status": "failure",
  "message": "Volume backup failed",
  "host": "default-my-data-pvc",
  "volume": "my-data-pvc"
}

Behavior

  • Webhooks are called from within the backup CronJob container, not from the operator itself
  • Webhook delivery is best-effort -- a single HTTP POST with no retries
  • Webhook failures do not affect the backup status -- the backup is considered successful even if the webhook fails
  • Webhook delivery failures are logged as warnings in the Job logs
  • Both success and failure webhooks use the same payload structure, differing only in the status field

Integration Examples

Uptime Monitoring

Point the success webhook at an uptime monitoring service (e.g., Healthchecks.io, UptimeRobot) to track backup regularity:

webhooks:
  success: "https://hc-ping.com/your-check-uuid"

Custom Relay

For services that require specific payload formats (e.g., Slack, PagerDuty), use a webhook relay or adapter service that accepts the operator's payload and transforms it:

webhooks:
  failure: "https://your-relay.example.com/backup-alert"

S3Backup Webhooks

S3Backup uses the same webhook configuration:

apiVersion: backups.k8s.bnerd.com/v1
kind: S3Backup
metadata:
  name: bucket-backup
spec:
  # ... backup configuration ...

  webhooks:
    success: "https://hooks.example.com/s3-backup-success"
    failure: "https://hooks.example.com/s3-backup-failure"