Git Sync
Manage ReliaPulse configuration as code with Git version control.
Overview
Git Sync enables infrastructure-as-code workflows:
- Store configuration in Git repositories
- Version control all changes
- Automate deployments via webhooks
- Detect and manage configuration drift
Supported Providers
| Provider | Webhook Support | API |
|---|---|---|
| GitHub | ✅ | ✅ |
| GitLab | ✅ | ✅ |
| Bitbucket | ✅ | ✅ |
| Generic Git | Manual only | - |
Setup
1. Create Configuration File
Create a YAML file in your repository:
# status-page.yaml
apiVersion: v1
kind: StatusPageConfig
metadata:
name: production-config
configVersion: "1.0.0"
spec:
componentGroups:
- name: Backend Services
order: 1
- name: Infrastructure
order: 2
components:
- name: API Gateway
type: SERVICE
group: Backend Services
status: operational
- name: API Health Check
type: ENDPOINT
group: Backend Services
url: https://api.example.com/health
method: GET
checkInterval: 60
conditions:
- type: STATUS_CODE
comparator: EQUALS
target: "200"
- name: Database CPU
type: METRIC
group: Infrastructure
integration: datadog-prod
query: avg:aws.rds.cpuutilization{*}
pollingInterval: 60
warningThreshold: 70
criticalThreshold: 90
integrations:
- name: datadog-prod
type: DATADOG
config:
site: US1
apiKey: ${DATADOG_API_KEY}
appKey: ${DATADOG_APP_KEY}2. Configure Git Sync
- Navigate to Settings > Git Sync
- Click "Configure"
- Fill in details:
| Field | Description |
|---|---|
| Provider | GitHub, GitLab, Bitbucket, Generic |
| Repository URL | Full repository URL |
| Branch | Branch to sync from |
| Config Path | Path to YAML file |
| Auth Method | Token, SSH Key, or GitHub App |
| Auto Sync | Enable webhook-triggered sync |
- Save configuration
3. Set Up Webhook (Optional)
For automatic sync on push:
- Copy the Webhook URL shown after saving
- Copy the Webhook Secret
- In your Git provider, create a webhook:
- URL: The webhook URL from ReliaPulse
- Secret: The webhook secret
- Events: Push events
- Content-Type: application/json
Configuration Schema
Root Structure
apiVersion: v1
kind: StatusPageConfig
metadata:
name: string # Config name
configVersion: string # Version identifier
spec:
componentGroups: [] # Component group definitions
components: [] # Component definitions
integrations: [] # Integration definitionsComponent Groups
componentGroups:
- name: Backend Services
order: 1
description: Core backend infrastructureComponents
SERVICE Type
components:
- name: API Gateway
type: SERVICE
group: Backend Services
description: Main API routing
status: operationalENDPOINT Type
components:
- name: Health Check
type: ENDPOINT
group: Backend Services
url: https://api.example.com/health
method: GET
checkInterval: 60
timeout: 5000
headers:
Authorization: Bearer ${API_TOKEN}
conditions:
- type: STATUS_CODE
comparator: EQUALS
target: "200"
- type: RESPONSE_TIME
comparator: LESS_THAN
target: "1000"
autoCreateIncident: true
failureThreshold: 3METRIC Type
components:
- name: CPU Usage
type: METRIC
group: Infrastructure
integration: datadog-prod
query: avg:system.cpu.user{*}
pollingInterval: 60
warningThreshold: 70
criticalThreshold: 90Integrations
integrations:
- name: datadog-prod
type: DATADOG
config:
site: US1
apiKey: ${DATADOG_API_KEY}
appKey: ${DATADOG_APP_KEY}
- name: prometheus-k8s
type: PROMETHEUS
config:
url: https://prometheus.example.com
username: ${PROMETHEUS_USER}
password: ${PROMETHEUS_PASS}Environment Variables
Reference environment variables with ${VAR_NAME}:
config:
apiKey: ${DATADOG_API_KEY}⚠️
Never commit secrets directly in YAML. Always use environment variables.
Set environment variables:
- In Docker: Add to
.envfile - In Kubernetes: Use ConfigMaps/Secrets
- In CI/CD: Set in pipeline configuration
Syncing
Manual Sync
- Navigate to Settings > Git Sync
- Click "Sync Now"
- View sync results
Automatic Sync
With webhooks configured:
- Push changes to the configured branch
- Webhook triggers sync
- Configuration is applied automatically
Sync History
View past syncs:
- Navigate to Settings > Git Sync
- Scroll to "Sync History"
- See status, timestamp, and changes
Drift Detection
Detect resources not managed by config:
GET /api/v1/config/driftResponse:
{
"totalResources": 15,
"managedByConfig": 10,
"manuallyCreated": 5,
"drift": [
{
"resourceType": "component",
"resourceName": "Manual Service",
"reason": "not_in_config"
}
]
}Handling Drift
Options for unmanaged resources:
- Add to config - Include in YAML file
- Delete manually - Remove from UI
- Ignore - Leave as manual override
Validation
Validate config before applying:
POST /api/v1/config/validate
Content-Type: application/yaml
<yaml content>Response:
{
"valid": true,
"warnings": [
"Component 'API' references non-existent integration 'old-datadog'"
]
}API Endpoints
| Endpoint | Description |
|---|---|
POST /config/validate | Validate YAML config |
POST /config/apply | Apply config |
GET /config/export | Export current config |
GET /config/drift | Detect drift |
GET /config/git-sync | Get sync config |
POST /config/git-sync | Create sync config |
PATCH /config/git-sync | Update sync config |
POST /config/git-sync/sync | Trigger manual sync |
GET /config/git-sync/history | Get sync history |
Best Practices
Repository Structure
/
├── status-page.yaml # Main config
├── .env.example # Example env vars
└── scripts/
└── validate.sh # Pre-commit validationVersion Control
- Use branches - Test changes in feature branches
- Review changes - Pull request workflow
- Tag releases - Track configuration versions
CI/CD Integration
# .github/workflows/status-page.yml
name: ReliaPulse Config
on:
push:
branches: [main]
paths: ['status-page.yaml']
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate config
run: |
curl -X POST $STATUS_PAGE_URL/api/v1/config/validate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/yaml" \
-d @status-page.yamlTroubleshooting
Sync Failed
- Check webhook signature
- Verify repository access
- Validate YAML syntax
- Check environment variables
Validation Errors
- Check YAML syntax
- Verify required fields
- Check integration references
- Validate component types
Webhook Not Triggering
- Verify webhook URL is correct
- Check webhook secret matches
- Confirm push events enabled
- Review webhook delivery logs
Related Documentation
- Settings - Configuration management
- API Reference - API endpoints
- Architecture - System design