A Velero backup manager for applications deployed by EOC.
AI-assisted development is governed by AGENTS.md (and Cursor rules under
.cursor/rules/). Task tracking uses Beads (bd). Project documentation lives under
documentation/ — including DESIGN, BACKUP, RESTORE, ADRs, and diagrams.
Huma serves generated API documentation at /docs and OpenAPI at /openapi.json or
/openapi.yaml.
git clone <repository-url>
cd backup-manager
go mod download
dev/):cp dev/env.example dev/.env
# Edit dev/.env with your values
All Task commands live under dev/ (no root Taskfile). List tasks with:
task -d dev
# or: task -d dev --list
task -d dev go:build # Compile backup-manager
task -d dev go:test # Unit tests with -race
task -d dev go:lint # golangci-lint
task -d dev local:run # Run backup-manager locally
task -d dev docker:image # Build image (push only if REGISTRY is set in dev/.env)
task -d dev local:install # Install in cluster (current context; requires Velero)
task -d dev local:uninstall # Remove backup-manager deployment only
task -d dev security:run # SAST + dependency scans
# 1. Download cluster kubeconfig
# 2. Configure dev/.env with your values
# 3. Start the service
task -d dev local:run
# 4. Access Huma API documentation
# http://localhost:8080/docs
Assumes an existing k3d cluster (with registry) and tools such as helm and kubectl.
Configure dev/.env first (RUSTFS_*, VELERO_*, REGISTRY / REGISTRY_PUSH,
VELERO_NAMESPACE=velero). VELERO_VERSION is the single version knob (Velero app image,
backup-manager image tag, and binary ldflags). backup-manager is installed via the local
Helm chart dev/helm/backup-manager/ with values
dev/helm-values/local.yaml.
# Install (bottom-up)
task -d dev rustfs:install # local S3 + backups bucket
task -d dev velero:install # requires RustFS (re-runs rustfs:install as a dep)
task -d dev local:install # requires Velero; builds/pushes image :$VELERO_VERSION
# Uninstall (top-down; each task removes only its own component)
task -d dev local:uninstall
task -d dev velero:uninstall # leaves Velero CRDs
task -d dev rustfs:uninstall # always deletes PVCs; keeps tools namespace
Manual Velero/API helpers (CLI vs API) live in dev/scripts/
(backup.sh, restore.sh, velero-lib.sh). These are not product runtime.
The service exposes metrics at the /metrics endpoint (configurable via METRICS_PATH):
# Refresh period (default: 15s)
METRICS_REFRESH_PERIOD=30s
# Metrics path (default: /metrics)
METRICS_PATH=/probes/metrics
# Pods wait timeout during restore (default: 5m)
PODS_WAIT_TIMEOUT=10m
Importable JSON under documentation/operations/grafana/:
backup-restore.jsonhttp-metrics.jsonGrafana Assistant CLI (grafana-assistant) talks to a
Grafana instance via the Assistant A2A API. Use it from a terminal or from Cursor (Grafana Labs
plugin / skill) to investigate metrics and dashboards for this service.
Install (binary must be on $PATH; do not rely on the agent to install it).
Preferred path on macOS: install the cask from the
Grafana Homebrew tap
(grafana/grafana). Requires Homebrew.
# One-shot install from the Grafana tap (cask)
brew install grafana/grafana/grafana-assistant
# Or tap first, then install
brew tap grafana/grafana
brew install --cask grafana-assistant
# Verify the binary (not only the cask metadata)
command -v grafana-assistant
grafana-assistant --version
brew list --cask grafana-assistant
The first run often triggers a system dialog (“Apple could not verify …” /
« Élément grafana-assistant non ouvert »). Choosing Move to Trash /
Placer dans la corbeille deletes the binary and leaves a broken symlink under
/opt/homebrew/Caskroom/grafana-assistant/... — later runs then look like
killed or command not found.
Do this instead:
grafana-assistant message, click Open Anyway, confirm.xattr -d com.apple.quarantine "$(brew --prefix)/bin/grafana-assistant"
# if the symlink target still exists:
xattr -dr com.apple.quarantine "$(brew --caskroom)/grafana-assistant"
grafana-assistant --version
If the binary was already trashed / missing from the Caskroom, reinstall then allow it as above (do not Trash it again):
brew reinstall --cask grafana/grafana/grafana-assistant
grafana-assistant --version
Upgrade later with:
brew update
brew upgrade --cask grafana-assistant
Official Homebrew notes: Use Grafana Assistant CLI (Install with Homebrew).
Quick configure and auth (replace URL with your Grafana stack):
grafana-assistant config set-instance mystack --url https://mystack.grafana.net
grafana-assistant config use-instance mystack
grafana-assistant auth # browser PKCE; needs Assistant CLI User (or Editor+)
grafana-assistant config add-project backup-manager "$(pwd)"
grafana-assistant prompt "List dashboards related to backup-manager metrics"
Config file resolution (first match wins): GRAFANA_ASSISTANT_CONFIG, ./grafana-assistant.yaml
(--local), or ~/.config/grafana-assistant/config.yaml. Overrides:
GRAFANA_URL / GRAFANA_SA_TOKEN.
Official docs and references
| Resource | URL |
|---|---|
| CLI install (incl. Homebrew) | grafana.com/docs/.../assistant/platform/cli |
| CLI source, install, releases | github.com/grafana/assistant-cli |
| Grafana Homebrew tap | github.com/grafana/homebrew-grafana |
| CLI Docker / GHCR packages | github.com/grafana/assistant-cli/pkgs |
| Grafana Assistant (product docs) | grafana.com/docs/grafana-cloud/machine-learning/assistant |
| This repo’s dashboards | documentation/operations/grafana/ |
# Kubernetes
KUBECONFIG=/path/to/kubeconfig.yaml
VELERO_NAMESPACE=velero
# Application
ENVIRONMENT=rli-ops10-dev01
APPLICATION=ida
VERSION=3.0.0
# ArgoCD (optional)
ARGOCD_DNS=argocd.example.com
ARGOCD_ADMIN_PWD=password
Local applications fixture: dev/config/applications.json (set via APPLICATIONS_CONFIG).
GET /api/version - Get the Velero server versionGET /api/backups - List backupsPOST /api/backups - Create a backup from a schedulePOST /api/backups/{name} - Create a named backupGET /api/backups/{name} - Get backup statusGET /api/backups/{name}/details - Get backup detailsGET /api/backups/{name}/logs - Get backup logsDELETE /api/backups/{name} - Delete a backupPOST /api/backups/cleanup - Clean up matching backupsGET /api/restores - List restoresPOST /api/restores - Create a restoreGET /api/restores/{name} - Get restore statusGET /api/restores/{name}/details - Get restore detailsGET /api/restores/{name}/logs - Get restore logsDELETE /api/restores/{name} - Delete a restorePOST /api/restores/cleanup - Clean up matching restoresAccess Huma API documentation or download
/openapi.json.
# Check configuration
cat dev/.env
# Check Kubernetes access
kubectl get pods -n velero
# Check endpoint
curl http://localhost:8080/metrics
# Check Prometheus configuration
# Check Velero logs
kubectl logs -n velero -l app=velero
# Check schedules
kubectl get schedules -n velero
| Doc | Path |
|---|---|
| Design | documentation/DESIGN.md |
| Backup | documentation/BACKUP.md |
| Restore | documentation/RESTORE.md |
| Integration tests | documentation/INTEGRATION_TESTS.md |
| Grafana dashboards | documentation/operations/grafana/ |
| ADRs | documentation/adr/ |
| Contributing | CONTRIBUTING.md |
| Agent governance | AGENTS.md |
See CONTRIBUTING.md. Summary: branch from develop, run
task -d dev go:test|lint|vet|fmt and security:run, update CHANGELOG.md, open a PR.
Agents never git push.
This project is licensed under [LICENSE].
Content type
Image
Digest
sha256:809b72b03…
Size
20.1 MB
Last updated
2 months ago
docker pull radiantone/eoc-backup-manager