How To-Host Syncing Works
When you create a resource in the virtual cluster that has to-host syncing enabled:- The syncer detects the new virtual resource
- A corresponding host resource is created with a translated name
- The syncer continuously keeps the resources in sync
- When the virtual resource is deleted, the host resource is also deleted
Name Translation
Resources synced to the host are renamed to prevent conflicts with other virtual clusters:Default Synced Resources
These resources sync to the host by default:Pods
Enabled by default - Essential for running workloads.Services
Enabled by default - Required for networking.Endpoints & EndpointSlices
Enabled by default - Track service endpoints.PersistentVolumeClaims
Enabled by default - Provides persistent storage.ConfigMaps & Secrets
Selective sync by default - Only syncs ConfigMaps and Secrets that are referenced by Pods.Optional Resources
These resources are disabled by default but can be enabled:Ingresses
NetworkPolicies
PriorityClasses
PodDisruptionBudgets
StorageClasses
ServiceAccounts
PersistentVolumes
VolumeSnapshots
Namespaces
ResourceClaims (Dynamic Resource Allocation)
Configuration Examples
Minimal Production Setup
Sync only essential resources:Full Feature Setup
Enable additional resources for advanced features:Air-Gapped Environment
Rewrite images for local registry:High Availability Setup
Enable PDBs and priority classes:Implementation Details
The to-host syncing logic is implemented inpkg/syncer/syncer.go:234:
pkg/controllers/resources/.
Selective Syncing
For ConfigMaps and Secrets, vCluster uses an importer pattern to selectively sync only resources that are actually used:- The pod syncer watches for ConfigMap and Secret references
- Only referenced ConfigMaps and Secrets are synced to the host
- This reduces resource overhead and improves security
Troubleshooting
Resource Not Appearing in Host Cluster
- Check if syncing is enabled for that resource type in
values.yaml - Verify resource was created in the virtual cluster
- Check vCluster logs for sync errors:
- Verify RBAC permissions in the host cluster
Resource Keeps Getting Deleted
This may be due to UID mismatch. Check the annotations on the host resource:vcluster.loft.sh/uid should match the virtual cluster resource UID.
ConfigMaps/Secrets Not Syncing
By default, only ConfigMaps and Secrets used by Pods are synced. Either:- Create a Pod that references them
- Enable
all: trueto sync all resources
Best Practices
- Start minimal: Only enable syncing for resources you need
- Use selective sync: Keep
configMaps.all: falseandsecrets.all: falseunless required - Monitor resource usage: More synced resources means more API calls and memory usage
- Test in development: Validate syncing configuration before production use
- Use PodDisruptionBudgets: For production workloads requiring high availability
Next Steps
- Learn about syncing from the host cluster
- Configure custom resource syncing
- Review networking configuration