Support unique hostpath for fuse sidecar mode in webhook #5181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Currently, Fluid injects the Fuse Client into Serverless Pods as a Sidecar to support Fuse Client integration in Serverless environments. The Sidecar handles data source mounting and propagates the mount point through HostPath.
In standard nodes, Fluid follows the typical CSI processing flow and tags the node with the Fuse Daemonset NodeSelector during the NodeStageVolume process. This results in a Daemonset Pod being deployed on the node to provide mount points for Pods referencing the dataset on that node. This involves the creation of a Daemonset and the Fluid CSI-plugin tagging the node, which triggers the Kubernetes Controller Manager (KCM) to expand the Daemonset on the node. When the scale of nodes or datasets is large, this can put significant pressure on the KCM. Consequently, there has emerged a need in standard nodes to integrate the Fuse Client via a sidecar approach as well.
However, when using the sidecar mode in standard nodes, the current code assigns the same hostpath to different pods using the same dataset. This can cause mounting conflicts when these pods are scheduled on the same node. Therefore, this PR aims to address this issue by providing two methods for generating hostpaths in sidecar mode.