Skip to main content
Version: main 🚧

Backup and restore vCluster Platform

This guide describes how to backup and restore the vCluster Platform management plane. To back up the connected clusters, reuse a regular Kubernetes backup solution such as Velero.

The vCluster Platform saves its state as Kubernetes Custom Resource Definition (CRD) objects. You can back up this state using Velero or the vCluster CLI command we created for convenience. This command saves all relevant Kubernetes resources to a single file.

You can run the vCluster CLI to back up these components at any time. The backup includes the following resources:

  • ClusterRoleTemplates
  • ClusterAccesses
  • SpaceConstraints
  • Users
  • Teams
  • SharedSecrets
  • AccessKeys
  • Apps
  • SpaceTemplates
  • VirtualClusterTemplates
  • Clusters and associated Kubernetes Secret objects
  • Projects
  • VirtualClusterInstances
  • SpaceInstances
  • ProjectSecrets

The platform backup includes only Custom Resource Definitions (CRDs). It does not include other resources used by the platform deployment or connected clusters, such as persistent volumes that store cost data. Use a Kubernetes backup solution such as Velero to back up these resources separately.

To create a backup using the default settings, run the following command. It saves the manifests for all of the components listed above to a file named backup.yaml in the current directory:

vcluster platform backup management

Alternatively, you cab specify the name for the backup file by running the command as:

vcluster platform backup management --filename vcluster-platform-backup.yaml

In some cases, the vCluster Platform might have been installed in a different namespace instead of the default vcluster-platform. If so, you can specify the correct namespace as shown in the following command:

vcluster platform backup management --namespace my-namespace

You can also exclude specific components from the backup by passing their names as a comma-separated list. The following example excludes users and teams from the backup:

vcluster platform backup management --skip users,teams

Restore vCluster Platform from backup​

The backup file contains the resource manifests for the vCluster Platform management plane. You can apply it like any standard Kubernetes manifest.

To restore, apply the backup to your cluster using the following command:

note

The backup contains vCluster Platform Custom Resource Definitions (CRDs), which must be installed in the cluster for the restore to succeed.

kubectl apply -f <backup-filename>.yaml

You might see warning messages similar to the following:

Warning: resource apps/argocd is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation is patched automatically.

These are just warnings and should not affect the restoration task.

Multiple Kubernetes clusters with the same vCluster Platform config

Do not install vCluster Platform (or its agents) into a cluster where it is already running. Running multiple vCluster Platform instances in the same cluster can cause reconciliation conflicts and lead to unexpected issues.