Skip to main content

Generic Sync

Besides the plugins, vCluster provides a way to define additional resources that should be synced in a generic and declarative way with just a few lines of YAML. This feature is a successor to the vcluster-generic-crd-sync-plugin project and is included since v0.14.0 release. The full range of the generic sync features is available only in the vCluster created in the "multi-namespace mode", see the "Multi-namespace Mode" chapter for details.

You will need to declare which CRD Kinds you would like to sync from the virtual cluster to the host cluster, or vice versa, and the vCluster will automatically copy the CRD definition from the host cluster into vCluster at the start. Then it will take care of watching the resources of the predefined Kinds and execute the synchronization logic based on the configuration provided to it. The vCluster may automatically transform the resource metadata(such as name, namespace, labels, etc.) as is common for resources synced by vCluster. In addition to the implicit metadata transformations, you can configure transformations that will be performed on other fields of the resource, and these will depend on the meaning of those fields. You may also declare which fields will be copied in the opposite direction, from the synced resource to the original one. Many controllers create Kubernetes resources as a result of custom resources, for example, cert-manager creates Secrets based on Certificate custom resources, and this feature will allow you to sync these resources from the host cluster into the virtual one. The following chapters describe the configuration options in more detail.

tip

You may find configuration examples in the "generic-sync-examples" folder in the vCluster repo.

Alpha feature

Generic sync feature is currently in an alpha state. This is an advanced feature that requires more permissions in the host cluster, and as a result, it can potentially cause significant disruption in the host cluster.