Skip to main content
Version: main 🚧

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.

Prerequisites

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.

Templates

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.

  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 enabled: true & central: true under the 'controlPlane.hostPathMapper' field in the vcluster.yaml.

  7. Finish configuring anything else on your virtual cluster, then click .