Skip to main content

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 in order 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 we would have 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.

Pre-Requisites

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.

Templates

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.

  1. From the project drop-down menu, select the project you'd like to create the virtual cluster in.

  2. Click the button above the list of virtual clusters

  3. [Optional] select the cluster in which to create the virtual cluster.

  4. Leave the Select a template section blank and click the to continue.

  5. Click the Advanced Options configuration tab and expand the 'Host Path Mapper' section.

  6. 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 the 'rewrite-host-paths=true' as extraArgs to the helm values for the syncer.

  7. Finish configuring anything else you'd like on your virtual cluster, then click the button.