Skip to main content

Map vCluster Service to Host Cluster Service

It is also possible to map a virtual cluster service to a host cluster service. This is especially useful if you want to expose an application that runs inside the virtual cluster to other workloads running in the host cluster. This makes it easier to share services across vCluster's. For example, to map a virtual service my-virtual-service in the namespace my-virtual-namespace to the vCluster host namespace service my-host-service, you can use the following config in your values.yaml:

mapServices:
fromVirtual:
- from: my-virtual-namespace/my-virtual-service
to: my-host-service

With this configuration, vCluster will manage a service called my-host-service inside the namespace where the vCluster workloads are synced, which points to the virtual service my-virtual-service in namespace my-virtual-namespace inside the vCluster. So pods in the host cluster will be able to access the virtual service via e.g. curl http://my-host-service.

To apply this change to an existing vcluster instance, simply run the following command:

vcluster create <CLUSTER_NAME> -f values.yaml --upgrade