vCluster synchronizes Kubernetes resources between the virtual cluster and the host cluster. This page describes how to configure which resources are synchronized and in which direction.
Sync Overview
Resource synchronization works in two directions:
ToHost : Resources created in the virtual cluster that are synced to the host cluster
FromHost : Resources from the host cluster that are synced into the virtual cluster
ToHost Synchronization
Configure resources to sync from the virtual cluster to the host cluster.
Core Resources
Pod synchronization configuration. Map images to alternative images for the host cluster. translateImage :
"my-image:latest" : "registry.company.com/my-image:v1.0.0"
Add tolerations to all synced pods. enforceTolerations :
- key : "node-role.kubernetes.io/control-plane"
operator : "Equal"
value : "true"
effect : "NoSchedule"
Runtime class to set for synced pods.
Priority class to set for synced pods.
Use secrets to save service account tokens instead of pod annotations.
Enable hybrid scheduling for pods (PRO feature). Enable hybrid scheduling.
List of schedulers deployed on the host cluster.
Rewrite /etc/hosts for StatefulSet pods to match virtual cluster FQDN. Enable host rewriting for StatefulSet pods.
Init container image configuration.
Secret synchronization configuration. Sync all secrets or only necessary ones.
ConfigMap synchronization configuration. Enable ConfigMap syncing.
Sync all ConfigMaps or only necessary ones.
Service synchronization configuration.
Endpoints synchronization configuration. Enable endpoints syncing.
sync.toHost.endpointSlices
EndpointSlices synchronization configuration. Enable EndpointSlices syncing.
Storage Resources
sync.toHost.persistentVolumeClaims
PersistentVolumeClaim synchronization.
sync.toHost.persistentVolumes
PersistentVolume synchronization.
sync.toHost.storageClasses
StorageClass synchronization. Enable StorageClass syncing.
sync.toHost.volumeSnapshots
VolumeSnapshot synchronization. Enable VolumeSnapshot syncing.
sync.toHost.volumeSnapshotContents
VolumeSnapshotContent synchronization. Enable VolumeSnapshotContent syncing.
Network Resources
sync.toHost.networkPolicies
NetworkPolicy synchronization. Enable NetworkPolicy syncing.
Other Resources
sync.toHost.serviceAccounts
ServiceAccount synchronization. Enable ServiceAccount syncing.
sync.toHost.podDisruptionBudgets
PodDisruptionBudget synchronization. Enable PodDisruptionBudget syncing.
sync.toHost.priorityClasses
PriorityClass synchronization. Enable PriorityClass syncing.
Namespace synchronization (PRO feature). Enable namespace syncing.
Only allow namespace creation if matched by mappings.
FromHost Synchronization
Configure resources to sync from the host cluster to the virtual cluster.
Events and Configs
Event synchronization from host to virtual cluster. Enable event syncing from host.
ConfigMap synchronization from host. Enable ConfigMap syncing from host.
Name-based mappings for ConfigMaps. mappings :
byName :
"host-namespace/config-name" : "vcluster-namespace/config-name"
"host-namespace/*" : "vcluster-namespace/*"
Secret synchronization from host. Enable secret syncing from host.
Name-based mappings for secrets.
Storage and CSI
sync.fromHost.storageClasses
StorageClass synchronization from host. Enable StorageClass syncing. auto enables when virtual scheduler is enabled.
CSIDriver synchronization from host. Enable CSIDriver syncing. auto enables when virtual scheduler is enabled.
CSINode synchronization from host. Enable CSINode syncing. auto enables when virtual scheduler is enabled.
sync.fromHost.csiStorageCapacities
CSIStorageCapacity synchronization from host. Enable CSIStorageCapacity syncing. auto enables when virtual scheduler is enabled.
Nodes
Node synchronization from host. Sync real nodes from host. If disabled, vCluster creates fake nodes.
Sync labels and taints from virtual cluster back to host nodes.
Clear image status when syncing nodes to hide pulled images.
Node selector configuration. Sync all nodes or only nodes with assigned pods.
Label selector for nodes to sync.
Other Resources
sync.fromHost.ingressClasses
IngressClass synchronization from host. Enable IngressClass syncing.
sync.fromHost.runtimeClasses
RuntimeClass synchronization from host. Enable RuntimeClass syncing.
sync.fromHost.priorityClasses
PriorityClass synchronization from host. Enable PriorityClass syncing.
Example: Basic Pod Syncing
sync :
toHost :
pods :
enabled : true
translateImage :
"nginx:latest" : "my-registry.com/nginx:1.21"
enforceTolerations :
- key : "workload"
operator : "Equal"
value : "vcluster"
effect : "NoSchedule"
Example: Sync All Secrets and ConfigMaps
sync :
toHost :
secrets :
enabled : true
all : true
configMaps :
enabled : true
all : true
Example: Host ConfigMap Mapping
sync :
fromHost :
configMaps :
enabled : true
mappings :
byName :
# Sync specific ConfigMap
"kube-system/coredns" : "kube-system/coredns"
# Sync all ConfigMaps from namespace
"monitoring/*" : "monitoring/*"
# Sync from vCluster host namespace to virtual namespace
"/shared-config" : "default/shared-config"
Example: Real Node Syncing
sync :
fromHost :
nodes :
enabled : true
syncBackChanges : false
clearImageStatus : true
selector :
all : false
labels :
vcluster-node : "true"
Example: Storage Syncing
sync :
toHost :
persistentVolumeClaims :
enabled : true
volumeSnapshots :
enabled : true
volumeSnapshotContents :
enabled : true
fromHost :
storageClasses :
enabled : true