Central HostPath Mapper
You can install a common logging solution such as Fluentd or the ELK stack on the host cluster and use it within the virtual cluster. However, in some scenarios, installing these tools directly on the virtual cluster is preferred.
These logging solutions access pod and container logs by mounting node host paths and using specific filename formats to associate logs with the correct pods. This approach doesn’t work in a vCluster because the vCluster rewrites pod names to a vCluster-specific format when syncing them to the host cluster.
The HostPath Mapper collects logs from virtual clusters. It works by matching virtual pod and container names to their physical names on the host and does this through symbolic links.
To enable HostPath Mapper for a virtual cluster, install a DaemonSet
in the same namespace. This setup works well for small environments with few nodes and virtual clusters.
As the number of nodes and virtual clusters grows, the number of required DaemonSet
pods also grows. Each virtual cluster needs one DaemonSet
per node, which increases resource usage.
The Central HostPath Mapper solves this problem. It installs a single DaemonSet
on the host cluster. This DaemonSet
manages host path remapping for all virtual clusters on the platform. It reduces overhead and simplifies cluster management.
To use this feature, install the Central HostPath Mapper on the host cluster. The component is available as a default vCluster Platform App in the Apps section. Install it before enabling the feature to ensure full capabilities are available.
This feature is only configurable from the UI for virtual clusters created without a template. When using a custom template that has the feature enabled, the UI does not display the configuration in Advanced Options as described below. In this case, configure the feature using the CLI or by modifying the manifests.
- During virtual cluster creation
- On an 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 on your virtual cluster, then click .
Select the project that contains the virtual cluster you want to enable Central HostPath Mapper on from the project drop-down menu.
Hover over the virtual cluster you would like to enable Central HostPath Mapper on to see an Edit button displayed. Click Edit.
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 on your virtual cluster, then click .