Skip to main content

Synopsis

Create and manage snapshots of virtual clusters for backup and restore.
vcluster snapshot [command] [flags]

Subcommands

  • create - Create a new snapshot
  • get - List existing snapshots
  • delete - Delete a snapshot

vcluster snapshot create

Create a snapshot of a virtual cluster.

Synopsis

vcluster snapshot create VCLUSTER_NAME [flags]

Examples

# Create snapshot to OCI registry
vcluster snapshot create my-vcluster -n team-x \
  --backend oci://myregistry.io/vcluster-snapshots

# Create snapshot to S3
vcluster snapshot create my-vcluster -n team-x \
  --backend s3://my-bucket/snapshots

# Create snapshot with name
vcluster snapshot create my-vcluster -n team-x \
  --backend oci://myregistry.io/snapshots \
  --name pre-upgrade-backup

Flags

--namespace
string
required
The Kubernetes namespace where the vCluster is running.
--backend
string
required
Storage backend for the snapshot. Supports: oci://, s3://, or local path.
--name
string
Custom name for the snapshot. Defaults to timestamp.
--include-volumes
boolean
Include persistent volume data in the snapshot.
--driver
string
default:"helm"
The driver to use.

vcluster snapshot get

List snapshots for a virtual cluster.

Synopsis

vcluster snapshot get VCLUSTER_NAME [flags]

Examples

# List snapshots
vcluster snapshot get my-vcluster -n team-x \
  --backend oci://myregistry.io/snapshots

# JSON output
vcluster snapshot get my-vcluster -n team-x \
  --backend oci://myregistry.io/snapshots \
  --output json

Flags

--namespace
string
required
The Kubernetes namespace.
--backend
string
required
Storage backend where snapshots are stored.
--output
string
default:"table"
Output format: table or json.

Complete Example

backup-workflow.sh
#!/bin/bash
VCLUSTER="prod-vcluster"
NAMESPACE="production"
BACKEND="oci://myregistry.io/backups"

# Create pre-upgrade snapshot
echo "Creating snapshot..."
vcluster snapshot create $VCLUSTER -n $NAMESPACE \
  --backend $BACKEND \
  --name "pre-upgrade-$(date +%Y%m%d)" \
  --include-volumes

# List all snapshots
echo "Available snapshots:"
vcluster snapshot get $VCLUSTER -n $NAMESPACE --backend $BACKEND

# Proceed with upgrade
vcluster create $VCLUSTER -n $NAMESPACE --upgrade

See Also

Build docs developers (and LLMs) love