| Enterprise | ||||
|---|---|---|---|---|
| Available in these plans | Free | Dev | Prod | Scale |
| Auto Snapshots | ||||
This feature is an Enterprise feature. See our pricing plans or contact our sales team for more information.
Snapshots
vCluster Platform allows you to configure taking snapshots of the vCluster at specific intervals.
For on-demand snapshot creation and restore operations, see the vCluster Snapshot and Restore documentation.
This allows administrators to capture and store the vCluster state in scheduled intervals to help protect against infrastructure failures, data corruption, and configuration errors. By maintaining consistent recovery points, administrators can quickly restore the vCluster to a known good state without relying on manual backup processes. For more details on how snapshots work, refer to the documentation in the Snapshot and Restore section.
In the vcluster.yaml, it is configured under snapshots. Using the UI, you
can configure the management of snapshots in the config options of a virtual cluster under Snapshots. Though
snapshot configuration is configured on the virtual cluster itself, the capability and logic of scheduling snapshots
is in vCluster Platform.
Auto Snapshot is supported from platform version 4.4.0 onward and is currently in Beta.
Volume Snapshot is currently in beta. Support is available from vCluster version 0.30 and beyond, and Platform version 4.5 and beyond.
Configureβ
- vcluster.yaml
- vCluster CLI
- Platform UI
Enable auto snapshotsβ
To enable auto snapshots, add the following configuration to your vcluster.yaml:
snapshots:
auto:
# Take a snapshot every 12 hours
schedule: 0 */12 * * *
# Default is UTC
# Options are at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: America/New_York
retention:
period: 30
maxSnapshots: 14
storage:
type: s3
s3:
url: s3://my-bucket/path
# Enables snapshots for PVCs that are provisioned by CSI drivers
volumes:
enabled: true
In order to create volume snapshots, several installation and configuration steps have to be done in your host or virtual cluster. Check the Volume Snapshot documentation page to learn more about getting your cluster ready for snapshotting volumes
AWS S3 bucket exampleβ
Snapshots can be stored in an AWS S3 bucket. When using AWS S3 buckets, it is recommended to authenticate using AWS pod identity. The EKS Pod Identity association must be created for the vCluster control plane pod. The vCluster control plane pod is the one that runs inside the host cluster namespace automatically created by vCluster Platform for each vClusterβtypically named: Alternatively, you can create a Kubernetes secret with your AWS credentials. Create a Kubernetes secret of your AWS credentials. Create this secret on the host of where the vCluster control plane is deployed. It could be deployed in the namespace
of the vCluster or a different namespace. If the vCluster is externally deployed, ensure the vCluster ClusterRole has permission to read the secret. The vCluster ClusterRole follows the naming pattern The secret needs to contain all these three keys: Create a vCluster referencing those credentials.Configure snapshots with AWS S3
S3 configuration optionsβ
Option Description auto.storage.type.s3.urlURL of the AWS S3 bucket. Must be pre-fixed with s3://.auto.storage.type.s3.credentialReferences the AWS credentials as a Kubernetes secret auto.storage.type.s3.credential.nameName of the Kubernetes secret. auto.storage.type.s3.credential.namespaceNamespace of the Kubernetes secret. The secret must be deployed on the host of where the vCluster control plane pod is deployed to. Authenticate with AWS Pod identityβ
loft-<project-name>-<vcluster-name>. By default, this pod uses the service account: vc-<vcluster-name>. This is the service account that must be associated with your EKS Pod Identity role so that the vCluster control plane can authenticate to AWS when performing scheduled snapshot creation to S3.snapshots:
auto:
# Take a snapshot every 12 hours
schedule: 0 */12 * * *
storage:
type: s3
s3:
# URL of location of S3-compatible bucket
# Must be prefixed with `s3://`
url: s3://<bucket-name>/snapshotsAuthenticate with AWS Credentials as a secretβ
vc-<vClusterName>-v-<vClusterNamespace>.
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKENkubectl create -f - <<EOF
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: aws-cred
namespace: p-default
data:
AWS_ACCESS_KEY_ID: "id"
AWS_SECRET_ACCESS_KEY: "key"
AWS_SESSION_TOKEN: "token"
EOFsnapshots:
auto:
# Take a snapshot every 12 hours
schedule: 0 */12 * * *
storage:
type: s3
s3:
# URL of location of S3-compatible bucket
# Must be prefixed with `s3://`
url: s3://<bucket-name>/<path>
# Secret must be located on the host cluster that the vCluster is deployed on
credential:
secretName: aws-cred
secretNamespace: p-default
OCI image registriesβ
Configure snapshots with OCI
OCI configuration optionsβ
| Option | Description |
|---|---|
auto.storage.type.oci.repository | OCI registry address. Must be pre-fixed with oci:// |
auto.storage.type.oci.credential | Reference the OCI credentials as a Kubernetes secret |
auto.storage.type.oci.credential.name | Name of the Kubernetes secret |
auto.storage.type.oci.credential.namespace | Namespace of the Kubernetes secret. The secret must be deployed on the host of where the vCluster control plane pod is deployed to. |
auto.storage.type.oci.username | Username of the credentials to access the OCI registry |
auto.storage.type.oci.password | Password of the credentials to access the OCI registry |
Authenticate with credentials in a Kubernetes secretβ
It's recommended to store your credentials to your OCI registry in a secret and reference the secret in the vcluster.yaml of your virtual cluster configuration. This protects the details of your credentials.
Create a Kubernetes secret of your credentials to your OCI registry.
Create this secret on the host of where the vCluster control plane is deployed. It could be deployed in the namespace of the vCluster or a different namespace. If the vCluster is externally deployed, ensure the vCluster ClusterRole has permission to read the secret. The vCluster ClusterRole follows the naming pattern
vc-<vClusterName>-v-<vClusterNamespace>.The secret needs to contain:
usernamepassword
Create OCI credentials secretkubectl create -f - <<EOF
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: oci-cred
namespace: p-default
data:
username: "id" # username to authenticate with the OCI registry
password: "key" # password base64 to authenticate with the OCI registry
EOFCreate a vCluster referencing those credentials.
Example vcluster.yaml referencing the Kubernetes secretsnapshots:
auto:
# Take a snapshot every 12 hours
schedule: 0 */12 * * *
storage:
type: oci
oci:
# Location of OCI registry
# Must be prefixed with `oci://`
repository: oci://my-registry/snapshots
credential:
secretName: oci-cred
secretNamespace: p-default
Authenticate without a Kubernetes secretβ
If you do not want to use a secret, you can also explicitly set the username and password
directly in the vcluster.yaml.
snapshots:
auto:
# Take a snapshot every 12 hours
schedule: 0 */12 * * *
storage:
type: oci
oci:
# Location of OCI registry
# Must be prefixed with `oci://`
repository: oci://my-registry/snapshots
credential:
username: "my-username"
password: "my-pasword"
Create an OCI snapshot (Helm driver)β
For virtual clusters deployed with the Helm driver (without platform):
vcluster snapshot create VCLUSTER_NAME --namespace NAMESPACE oci://ghcr.io/my-user/my-repo:my-tag
This will take a snapshot of the virtual cluster and saves it as an OCI image.
Create an AWS S3 snapshot (Helm driver)β
For virtual clusters deployed with the Helm driver (without platform):
vcluster snapshot create VCLUSTER_NAME --namespace NAMESPACE s3://my-bucket/my-bucket-key
This will take a snapshot of the virtual cluster and saves it to a AWS S3 bucket.
There might be additional enryption settings necessary for AWS, which can be configured with following flags:
- --customer-key-encryption-file
- --kms-key-id
- --server-side-encryption
Create a container filesystem snapshot (Helm driver)β
For virtual clusters deployed with the Helm driver (without platform):
vcluster snapshot create VCLUSTER_NAME --namespace NAMESPACE container:///data/my-local-snapshot.tar.gz
This will take a snapshot of the virtual cluster to the vCluster container filesystem.
From the project drop-down menu (top left corner), select the project you'd like to create the virtual cluster in.
Click on Virtual Clusters.
Click on Edit on the virtual cluster that you want to edit.
Select the expander, toggle the Enable Snapshots slider to enable auto snapshots and configure accordingly.
Click on the button to save the changes.
Config referenceβ
snapshots required object β
Snapshots holds configuration for automatic vCluster snapshots.
snapshots required object βauto required object β
Auto holds automatic snapshot configuration
auto required object βschedule required string β
Schedule specifies a scheduled time in Cron format, see https://en.wikipedia.org/wiki/Cron for a virtual cluster snapshot to be taken
schedule required string βtimezone required string β
Timezone specifies time zone used for scheduled snapshot operations. Defaults to UTC.
Accepts the same format as time.LoadLocation() in Go (https://pkg.go.dev/time#LoadLocation).
The value should be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York".
timezone required string βretention required object β
Retention specifies how long snapshots will be kept
retention required object βstorage required object β
Storage specifies where the snapshot will be stored
storage required object βtype required string β
Type specifies supported type of storage services for a snapshot S3/OCI/Container, see https://www.vcluster.com/docs/vcluster/manage/backup-restore#store-snapshots-in-s3-buckets
type required string βs3 required object β
S3 holds configuration for storing snapshots in S3-compatible bucket
s3 required object βoci required object β
OCI holds configuration for storing snapshots in OCI image registries
oci required object βcontainer required object β
Container holds configuration for storing snapshots as local files inside a vCluster container
container required object β