01cloud-backup is a Go-based gRPC service for orchestrating Kubernetes backup and restore workflows with Velero. It exposes a programmatic API for creating, listing, preserving, restoring, and deleting backups, while also persisting metadata in PostgreSQL and sending live status updates over WebSocket.
This project is a good fit if you want to build a platform, internal tool, or control plane that needs backup automation without wiring directly into Velero commands by hand.
- gRPC-first API for backup workflows
- Velero-backed backup and restore orchestration
- PostgreSQL-backed metadata persistence
- WebSocket notifications for status streaming
- Label and settings support for repeatable workflows
- Container-friendly development and build flow
- Overview
- How It Works
- Features
- Tech Stack
- Prerequisites
- Quick Start
- Configuration
- Usage
- API Surface
- Project Layout
- Development
- Docker
- Contributing
- Security
- License
The service sits between your clients and your cluster backup system:
- clients call a gRPC API
- the service translates those calls into Velero operations
- backup metadata and restore-related state are stored in PostgreSQL
- status updates can be pushed to connected consumers through WebSocket
That makes 01cloud-backup useful as a backend component for dashboards, control planes, automation pipelines, or multi-tenant platform tooling.
gRPC client
|
v
01cloud-backup
|
+--> Velero / Kubernetes resources
+--> PostgreSQL metadata storage
+--> WebSocket status broadcast
High-level request flow:
- A client sends a backup or restore request over gRPC.
- The service validates the request and invokes the corresponding backup logic.
- Velero resources are created or queried inside the target cluster.
- Backup metadata, labels, and settings are stored in PostgreSQL.
- Status can be published to downstream consumers through WebSocket.
- Create a backup for a namespace or workload scope
- List existing backups with pagination support
- Fetch backup details for a specific backup
- Preserve important backups from cleanup workflows
- Restore from an existing backup
- Delete backups and associated metadata
- Save backup settings for reuse
- Retrieve saved backup settings by namespace
- Attach labels to backups for filtering and organization
- Track environment-related metadata to improve restore fidelity
- Support restore listing workflows through the gRPC API
- Push status information through WebSocket connections
- Go 1.20+
- gRPC / Protocol Buffers
- Velero
- Kubernetes client libraries
- PostgreSQL
- Docker
Before running the service, make sure you have:
| Requirement | Notes |
|---|---|
| Go | 1.20 or later |
| Docker | Recommended for repeatable local builds |
| Kubernetes cluster | Required for real Velero-backed workflows |
| Velero | Installed and configured in the target cluster |
| PostgreSQL | Required for metadata persistence |
If Velero is not installed yet, start with the official Velero installation guide.
git clone https://github.com/berrybytes/01cloud-backup.git
cd 01cloud-backupcp .env.sample .envAt minimum, review:
GRPC_SERVER_PORTDB_HOSTDB_PORTDB_USERDB_PASSWORDDB_NAMEDB_BACKUP_PATHWS_SERVERAPI_URLAPI_SECRET
go mod downloadmake run-devThe server listens on the address configured by GRPC_SERVER_PORT.
The application uses environment variables loaded from .env.
Example bootstrap:
cp .env.sample .envCurrent environment keys from .env.sample:
| Variable | Required | Description |
|---|---|---|
DEBUG |
No | Enables debug logging when set to true |
GRPC_SERVER_PORT |
Yes | Bind address for the gRPC server |
| Variable | Required | Description |
|---|---|---|
GCLOUD_PROJECT |
No | GCP project identifier when applicable |
GCLOUD_NAMESPACE |
No | Namespace or related cloud scoping value |
WS_SERVER |
Yes | WebSocket destination for status updates |
API_URL |
Yes | Upstream API endpoint |
API_SECRET |
Yes | Authentication token or secret for upstream API calls |
| Variable | Required | Description |
|---|---|---|
DB_HOST |
Yes | PostgreSQL host |
DB_PORT |
Yes | PostgreSQL port |
DB_USER |
Yes | PostgreSQL username |
DB_PASSWORD |
Yes | PostgreSQL password |
DB_NAME |
Yes | PostgreSQL database name |
DB_BACKUP_PATH |
Yes | Filesystem path used for backup-related local storage |
Security notes:
.envshould stay uncommitted- use secret managers in production
- avoid pasting real credentials into issues or pull requests
make run-devmake test-devmake lintmake formatmake helpProtocol buffer definitions live in pkg/proto/backup/backup.proto.
The primary gRPC service is Backup, with these RPCs:
| RPC | Purpose |
|---|---|
CreateBackup |
Start a backup |
ListBackup |
List backups |
DetailBackup |
Get backup details |
PreserveBackup |
Mark or unmark a backup as preserved |
RestoreBackup |
Trigger a restore |
RestoreListBackup |
List restorable backups |
DeleteBackup |
Delete a backup |
GetSettingBackup |
Get saved backup settings |
SaveSettingBackup |
Save backup settings |
AddLabelBackup |
Add labels to a backup |
If you need to regenerate protobuf artifacts, use the Make target that exists in this repo:
make grpc-compileThis README now reflects the actual repository layout:
01cloud-backup/
├── cmd/server/main.go
├── internal/backup/
├── internal/common/
├── internal/helper/
├── internal/model/
├── internal/repository/
├── internal/velero/
├── pkg/proto/backup/
├── .env.sample
├── Dockerfile
├── Makefile
└── README.md
Directory guide:
cmd/servercontains the application entrypointinternal/backupcontains gRPC server and backup workflow logicinternal/velerocontains Velero integration codeinternal/repositorycontains persistence-related codeinternal/modelcontains domain and database modelsinternal/helpercontains shared helpers and utility codepkg/proto/backupcontains protobuf definitions and generated Go stubs
make format
make test-dev
make lint- the service loads configuration from
.env - the current entrypoint is cmd/server/main.go
- some Make targets use Docker-based flows
- cluster-dependent features require a working Kubernetes + Velero setup
Open source contributors can add value quickly by helping with:
- test coverage for backup and restore flows
- README examples and API usage snippets
- stronger local development docs
- CI hardening and release automation
- validation and error handling improvements
Build the image locally:
docker build -t 01cloud-backup:latest .Run the container:
docker run --env-file .env -p 50051:50051 01cloud-backup:latest- ABOUT.md — Project mission, architecture, and why it exists
- RELEASES.md — Release process, versioning, and publishing procedures
- CHANGELOG.md — Version history and notable changes
- CONTRIBUTING.md — How to contribute code and improvements
- CODE_OF_CONDUCT.md — Community guidelines and expectations
- SECURITY.md — Security policy and vulnerability reporting
Contributions are welcome.
Before opening a pull request, please review:
Helpful things to include in issues:
- your Go version
- Kubernetes version
- Velero version
- steps to reproduce
- relevant logs or error output
- configuration details with secrets removed
If you discover a security issue, please follow the guidance in SECURITY.md.
Licensed under the Apache License 2.0.