Map Host Cluster Service to vCluster Service
For example, to map a service my-host-service
in the namespace my-host-namespace
to the virtual cluster service my-virtual-service
in the virtual cluster namespace my-virtual-namespace
, you can use the following config in your values.yaml
:
mapServices:
fromHost:
- from: my-host-namespace/my-host-service
to: my-virtual-namespace/my-virtual-service
With this configuration, vCluster will manage a service called my-virtual-service
inside the virtual cluster that points to the host service my-host-service
in namespace my-host-namespace
. So pods inside the vCluster will be able to access the host service via e.g. curl http://my-virtual-service.my-virtual-namespace
.
To apply this change to an existing vcluster instance, simply run the following command:
vcluster create <CLUSTER_NAME> -f values.yaml --upgrade