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
successandfailurewebhooks use the same payload structure, differing only in thestatusfield
Integration Examples¶
Uptime Monitoring¶
Point the success webhook at an uptime monitoring service (e.g., Healthchecks.io, UptimeRobot) to track backup regularity:
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:
S3Backup Webhooks¶
S3Backup uses the same webhook configuration: