Automation Guide
Automate checkpointing workflows with SnapHook webhooks and CI/CD integration.
SnapHook Webhooks
Creating SnapHooks
- Navigate to SnapHook > Create SnapHook
- Configure:
Name: production-snaphook Cluster: production-cluster Webhook URL: https://snap.company.com/webhook Namespace: snap
Webhook Events
- Pod Created: Trigger on new pod creation
- Pod Updated: Trigger on pod changes
- Scheduled: Time-based triggers
- Custom: Custom event triggers
CI/CD Integration
GitHub Actions
name: SNAP Checkpoint
on:
push:
branches: [ main ]
jobs:
checkpoint:
runs-on: ubuntu-latest
steps:
- name: Create Checkpoint
run: |
curl -X POST "$/checkpoint/kubelet/checkpoint" \
-H "Authorization: Bearer $" \
-H "Content-Type: application/json" \
-d '{
"pod_name": "app-pod",
"namespace": "default",
"cluster_name": "production"
}'
Jenkins Pipeline
pipeline {
agent any
stages {
stage('Checkpoint') {
steps {
script {
def response = httpRequest(
url: 'http://snap-api:8000/checkpoint/kubelet/checkpoint',
httpMode: 'POST',
contentType: 'APPLICATION_JSON',
requestBody: '{"pod_name": "app-pod", "namespace": "default"}'
)
}
}
}
}
}
Automated Workflows
Disaster Recovery
- Scheduled checkpoints: Regular backup creation
- Cross-region sync: Automatic replication
- Health checks: Monitor checkpoint integrity
Application Migration
- Blue-green deployment: Checkpoint before switch
- Rollback capability: Instant rollback from checkpoints
- State preservation: Maintain application state
Monitoring and Alerting
Metrics Collection
- Checkpoint success rate: Track checkpoint reliability
- Performance metrics: Monitor checkpoint timing
- Storage usage: Track checkpoint storage
Alerting Rules
- Failed checkpoints: Alert on checkpoint failures
- Storage threshold: Alert on storage limits
- Performance degradation: Alert on slow checkpoints