Kopiur: A Kopia-Powered Kubernetes Backup Operator in Rust Separating Recipe, Trigger, and ScheduleNote · digest for December 3
Engraving and risograph print on textured paper: three separate Kopiur operator modules—volume recipe, schedule, and snapshot—linked cleanly into a reliable backup loop.
Note3 sections≈ 4 min

Kopiur: A Kopia-Powered Kubernetes Backup Operator in Rust Separating Recipe, Trigger, and Schedule

Setting up PVC (Persistent Volume Claim) backups in Kubernetes looks simple at first: drop in a manifest with a cron string and forget it. Behind the scenes, recipe, schedule, and execution are glued into one resource running bash scripts inside a pod. Triggering an on-demand snapshot before a DB migration from a Helm hook or Argo Events becomes a headache.

Kopiur tackles this with a Rust (kube-rs) operator built on Kopia's encrypted, deduplicated backup engine. It's still alpha 0.11.2 (kopiur.home-operations.com/v1alpha1), yet its resource design is noticeably cleaner than VolSync.

Why separate recipe from schedule and how the 9 CRDs work

VolSync with restic has been the standard for PVC backups. The perfectra1n/volsync fork added Kopia support, though PR #1723 sat open for over a year. The home-operations team built Kopiur from scratch (ADR-0003), borrowing resource separation from CloudNativePG and Tekton.

The API defines nine CRDs (custom Kubernetes resources). Repository and ClusterRepository define storage; SnapshotPolicy defines the recipe (PVCs, retention, and fan-out to 1–8 repos); SnapshotSchedule handles cron with H hashing, jitter, and runOnCreate: false. Each actual backup run is a Snapshot object—created by cron, kubectl create, Argo Events, or a Helm hook. A Kubernetes finalizer links it to the Kopia snapshot: deletionPolicy: Delete removes it from the repo too, while older copies use Retain. The other four CRDs cover Restore, Maintenance, 3-2-1 RepositoryReplication, and SnapshotReplication.

CRD schemas use Rust enums (backend.s3 instead of a bag of untyped fields), an axum webhook catches errors on apply, and a Rust binary inside the pod drives kopia --json:

# S3 repository (with credentials and encryption password secret)
apiVersion: kopiur.home-operations.com/v1alpha1
kind: Repository
metadata: { name: nas-primary, namespace: billing }
spec:
  backend:
    s3:
      bucket: my-backups
      endpoint: s3.us-east-1.amazonaws.com
      auth: { secretRef: { name: nas-primary-creds } }
  encryption:
    passwordSecretRef: { name: nas-primary-creds, key: KOPIA_PASSWORD }
  create: { enabled: true }
---
# PVC backup recipe and schedule
apiVersion: kopiur.home-operations.com/v1alpha1
kind: SnapshotPolicy
metadata: { name: postgres-data, namespace: billing }
spec:
  repository: { kind: Repository, name: nas-primary }
  sources: [{ pvc: { name: postgres-data } }]
  retention: { keepDaily: 14, keepWeekly: 4 }
---
apiVersion: kopiur.home-operations.com/v1alpha1
kind: SnapshotSchedule
metadata: { name: postgres-data-nightly, namespace: billing }
spec:
  policyRef: { name: postgres-data }
  schedule: { cron: "H 2 * * *", jitter: 30m, runOnCreate: false }

Those three layers stay decoupled: you can attach a second schedule or a one-off pre-release snapshot to the same SnapshotPolicy without touching cron.

Installing via OCI chart and using kubectl kopiur

Kopiur needs Kubernetes >= 1.24, plus a CSI snapshot-controller for copyMethod: Snapshot (otherwise use Direct). Install the Cosign-signed OCI chart rather than raw git manifests—the controller issues its own webhook cert without cert-manager. Supported backends include S3/MinIO, Azure Blob, GCS, B2, PVC, NFS, SFTP, WebDAV, Google Drive, and rclone:

# Install OCI chart and CLI plugin (also on Homebrew tap)
helm install kopiur oci://ghcr.io/home-operations/charts/kopiur \
  --namespace kopiur-system --create-namespace
kubectl krew install kopiur
kubectl kopiur status && kubectl kopiur doctor

# In-place migration from the Kopia fork of VolSync
kubectl kopiur migrate volsync -n media --resolve-secrets --apply

The plugin migrates VolSync configs directly: perfectra1n/volsync keeps its backup history, while restic setups convert manifests only (remember to replace REPLACE_ME passwords). Note that helm upgrade skips crds/, which causes the API server to strip new fields—apply CRD updates with kubectl apply --server-side -f deploy/crds/ and verify with kubectl kopiur doctor.

v1alpha1 status, AGPL-3.0 license, and lessons learned

Kopiur launched in June 2026, and v1alpha1 means it: 0.6.0 already changed schemas and resource names. The Kopiur docs openly document past incidents that led to safeguards—after kro flapping spawned 600–700 delete Jobs they added deletionProtection and batched cleanup, and after a Garage S3 outage broke 53 Snapshot runs they added a repo health circuit breaker (Degrade).

The license is AGPL-3.0-only, a strict copyleft: fine for running inside your own cluster, while SaaS teams modifying the operator should check with legal. Today Kopiur is great for homelabs, staging, and replacing perfectra1n/volsync—save mission-critical production for post-v1alpha1.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 4