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.
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 the 'rewrite-host-paths=true' as extraArgs to the helm values for the syncer.
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 the 'rewrite-host-paths=true' as extraArgs to the helm values for the syncer.
Finish configuring anything else you'd like on your virtual cluster, then click the button.