Volume snapshots
By default, this is disabled.
Sync VolumeSnapshot and VolumeSnapshotContent resources from the tenant cluster to the control plane cluster. These two resources work together. A VolumeSnapshot is the tenant-facing request for a snapshot of a PersistentVolumeClaim. A VolumeSnapshotContent is the underlying snapshot resource that a CSI driver provisions in response.
Prerequisites​
- A CSI driver with snapshot support, its CSI snapshotter sidecar, and the common snapshot controller installed in the control plane cluster. See the external-snapshotter project for these components.
- The VolumeSnapshot, VolumeSnapshotContent, and VolumeSnapshotClass CRDs installed in the control plane cluster. When enabled, vCluster tries to detect these CRDs on the control plane cluster and fails to start up if they're missing.
- A VolumeSnapshotClass available in the control plane cluster for the CSI driver you're using. Sync it into the tenant cluster with
sync.fromHost.volumeSnapshotClasses, since a VolumeSnapshot normally references a VolumeSnapshotClass by name to resolve which driver takes the snapshot.
Enable syncing VolumeSnapshots and VolumeSnapshotContents to the control plane cluster​
sync:
fromHost:
# Make the control plane cluster's snapshot classes available to users.
volumeSnapshotClasses:
enabled: true
toHost:
volumeSnapshots:
enabled: true
volumeSnapshotContents:
enabled: true
You must enable volumeSnapshots and volumeSnapshotContents together. vCluster rejects a configuration that enables only one of these resources because each VolumeSnapshot depends on a corresponding VolumeSnapshotContent.
RBAC​
Enabling volume snapshot syncing requires additional RBAC permissions for the vCluster ServiceAccount to manage VolumeSnapshot and VolumeSnapshotContent resources in the control plane cluster. rbac.enableVolumeSnapshotRules defaults to auto and adds these permissions automatically when volume snapshot syncing is enabled.
Patches​
Use sync.toHost.volumeSnapshots.patches and sync.toHost.volumeSnapshotContents.patches to transform these resources' fields while syncing to the control plane cluster. See Patching synced resources for syntax, directionality, and examples.
Config reference​
volumeSnapshots​
volumeSnapshots object ​
VolumeSnapshots defines if volume snapshots created within the virtual cluster should get synced to the host cluster.
volumeSnapshots object ​enabled boolean false ​
Enabled defines if this option should be enabled.
enabled boolean false ​patches object[] ​
Patches patch the resource according to the provided specification.
patches object[] ​path required string ​
Path is the path within the patch to target. If the path is not found within the patch, the patch is not applied.
path required string ​expression string ​
Expression transforms the value according to the given JavaScript expression.
expression string ​reverseExpression string ​
ReverseExpression transforms the value according to the given JavaScript expression.
reverseExpression string ​reference object ​
Reference treats the path value as a reference to another object and will rewrite it based on the chosen mode
automatically. In single-namespace mode this will translate the name to "vxxxxxxxxx" to avoid conflicts with
other names, in multi-namespace mode this will not translate the name.
reference object ​apiVersion required string ​
APIVersion is the apiVersion of the referenced object.
apiVersion required string ​apiVersionPath string ​
APIVersionPath is optional relative path to use to determine the kind. If APIVersionPath is not found, will fallback to apiVersion.
apiVersionPath string ​kind required string ​
Kind is the kind of the referenced object.
kind required string ​kindPath string ​
KindPath is the optional relative path to use to determine the kind. If KindPath is not found, will fallback to kind.
kindPath string ​namePath string ​
NamePath is the optional relative path to the reference name within the object.
namePath string ​namespacePath string ​
NamespacePath is the optional relative path to the reference namespace within the object. If omitted or not found, namespacePath equals to the
metadata.namespace path of the object.
namespacePath string ​labels object ​
Labels treats the path value as a labels selector.
labels object ​volumeSnapshotContents​
volumeSnapshotContents object ​
VolumeSnapshotContents defines if volume snapshot contents created within the virtual cluster should get synced to the host cluster.
volumeSnapshotContents object ​enabled boolean false ​
Enabled defines if this option should be enabled.
enabled boolean false ​patches object[] ​
Patches patch the resource according to the provided specification.
patches object[] ​path required string ​
Path is the path within the patch to target. If the path is not found within the patch, the patch is not applied.
path required string ​expression string ​
Expression transforms the value according to the given JavaScript expression.
expression string ​reverseExpression string ​
ReverseExpression transforms the value according to the given JavaScript expression.
reverseExpression string ​reference object ​
Reference treats the path value as a reference to another object and will rewrite it based on the chosen mode
automatically. In single-namespace mode this will translate the name to "vxxxxxxxxx" to avoid conflicts with
other names, in multi-namespace mode this will not translate the name.
reference object ​apiVersion required string ​
APIVersion is the apiVersion of the referenced object.
apiVersion required string ​apiVersionPath string ​
APIVersionPath is optional relative path to use to determine the kind. If APIVersionPath is not found, will fallback to apiVersion.
apiVersionPath string ​kind required string ​
Kind is the kind of the referenced object.
kind required string ​kindPath string ​
KindPath is the optional relative path to use to determine the kind. If KindPath is not found, will fallback to kind.
kindPath string ​namePath string ​
NamePath is the optional relative path to the reference name within the object.
namePath string ​namespacePath string ​
NamespacePath is the optional relative path to the reference namespace within the object. If omitted or not found, namespacePath equals to the
metadata.namespace path of the object.
namespacePath string ​labels object ​
Labels treats the path value as a labels selector.
labels object ​