Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What hostpathMapper does exactly? #1099

Closed
felipecrs opened this issue Jun 26, 2023 · 3 comments
Closed

What hostpathMapper does exactly? #1099

felipecrs opened this issue Jun 26, 2023 · 3 comments

Comments

@felipecrs
Copy link
Contributor

felipecrs commented Jun 26, 2023

Sorry to ask, but I found no references about it. Two places in the documentation mention that it requires hostpathMapper, but the purpose of it, and what it does, is never explained:

The helm chart also contains no documentation about it:

  • hostpathMapper:
    # Image to use for the hostpathMapper
    # image: ghcr.io/loft-sh/vcluster
    enabled: false
    resources: {}
    # limits:
    # cpu: 40m
    # memory: 100Mi
    # requests:
    # cpu: 20m
    # memory: 50Mi

The reason why I ask is because I have some pods that uses some hostPath mounts, and thus I cannot enable isolation with podSecurityStandard: baseline. These pods writes some logs into the node directly through these mounts, and when deleting the vcluster, these logs are left behind the cluster.

Then, I wonder if the hostpathMapper feature can help me "isolate" such behavior, so that when deleting the vcluster these logs would also get deleted from the node.

@ishankhare07
Copy link
Contributor

Hi @felipecrs , the hostPathMapper is basically a feature for enabling logging solutions like fluentd etc. and backup solutions like velero to work inside the vcluster.

You see when the fluentd daemonset agent tries to query the APIServer(virtual) for PodList it gets a list of pods who's name, namespace, UID etc. are different from the actual (physical) pods.

The above details from the physical pods are actually the name of the logfiles for each pod logging on the respective node. So hostpath mapper makes sure to connect those expected and link them with their corresponding so that agents like fluentd, loki, elk etc. can find the correct log files to scrape. Same is the case for velero but in a different dir – /var/kubelet/pods

@felipecrs
Copy link
Contributor Author

I see, thank you!

@SCLogo
Copy link

SCLogo commented Feb 5, 2024

sorry to ask here. you mention hostpathmapper to able to use velero inside... can you send me a working example?
I have a velero inside and when I delete the pvc and the pv and tries to restore from backup I lost all my data because of the issue:
#1324

Maybe I set something wrong.
Thanks

@ishankhare07 ishankhare07 removed their assignment Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants