Central HostPath Mapper
While it is possible to install a common logging solution such as FluentD or ELK stack on the host cluster and then use it inside the virtual cluster, there are certain use cases where you would want to install them directly on the virtual cluster. These solutions mount the node host paths directly to access the pod and container logs and rely on the filenames to be a certain format to map the logs to the appropriate pods. However inside a vCluster, this would not work as the vCluster rewrites the names of the pods to a vCluster specific format when it syncs the pods down to the host cluster.
HostPath Mapper was developed to support this by resolving the correct virtual pod and container names to their physical
counterparts via the use of symbolic links. It can be enabled per virtual cluster and is installed as a Daemonset
. This works
well for a smaller cluster with fewer nodes and virtual clusters. However, as the number of nodes and virtual clusters
increases, the number of pods required just for the HostPath Mapper increases as there would be one Daemonset
per virtual
cluster per node.
With Central HostPath Mapper, this is optimized with just a one Daemonset
installed on the host cluster that manages
the hostpath remapping for all the virtual clusters created on this host cluster.
This feature requires the Central HostPath Mapper to be present in the host cluster. It is available as a default vCluster Platform App under the Apps Section. Make sure to install it beforehand for all the features to work correctly.
This feature is only configurable from the UI with virtual clusters that are created without a template. If you create your own template that has it enabled, you still won't see the UI configuration under Advanced Options as described below and configuration should be done via the CLI or by changes to manifests.
- During Virtual Cluster Creation
- On Existing Virtual Cluster
From the project drop-down menu, select the project you'd like to create the virtual cluster in.
Click the button above the list of virtual clusters
[Optional] select the cluster in which to create the virtual cluster.
Leave the Select a template section blank and click the to continue.
Click the Advanced Options configuration tab and expand the 'Host Path Mapper' section.
Toggle the slider Enable. This will add the 'loft.sh/hpm-enabled' annotation to the template metadata which will be automatically synced to the virtual cluster on creation. Secondly, it will add
enabled: true
¢ral: true
under the 'controlPlane.hostPathMapper' field in the vcluster.yaml.Finish configuring anything else you'd like on your virtual cluster, then click the button.
From the project drop-down menu, select the project with the virtual cluster you'd like to enable Central HostPath Mapper on.
Hover over the virtual cluster you'd like to enable Central HostPath Mapper on to see an Edit button appear. Click the Edit button.
Click the Advanced Options configuration tab and expand the 'Host Path Mapper' section.
Toggle the slider Enable. This will add the 'loft.sh/hpm-enabled' annotation to the template metadata which will be automatically synced to the virtual cluster on creation. Secondly, it will add
enabled: true
¢ral: true
under the 'controlPlane.hostPathMapper' field in the vcluster.yaml.Finish configuring anything else you'd like on your virtual cluster, then click the button.