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

[kind] mount host /sys into kind node #1365

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YoannGh
Copy link
Contributor

@YoannGh YoannGh commented Jan 16, 2025

What does this PR do?

Similarly to #774, the system-probe container needs access to the host /sys filesystem to retrieve cgroup data of processes. This PR hence updates the kind node configuration to mount the host /sys directory into the control-plane container so that it can be propagated to the system-probe container.

Which scenarios this will impact?

Motivation

Additional Notes

@YoannGh YoannGh requested a review from a team as a code owner January 16, 2025 15:56
- role: control-plane
extraMounts:
- hostPath: /proc
containerPath: /host/proc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will put again my comment from #774 (comment)

With Kind we're not testing with real host proc or host sys as we are not interested in the PIDs and containers not managed by Kind, we never had any issue so far, so I am not sure the use case is valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure what you mean by

we are not interested in the PIDs and containers not managed by Kind

Maybe I'm wrong but I think CWS needs these extra mounts because of nested namespace issues, i.e. the Kind node is a container running other containers.
In the case of CWS, the data we get from the kernel is from the perspective of the root PID namespace so we need to mount the real host proc path to have the correct PID mapping, otherwise we will look at the PIDs of the namespace of the Kind node and the PIDs mapping will be wrong.
This is the same issue for the host sys path because the cgroup membership in /proc is relative to the cgroup namespace, so we need access to /host/sys/fs/cgroup/[cgroup]/cgroup.procs to validate the cgroup mapping for a given PID.
Let me know if you think there's another way to solve these namespace mapping issues.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I'm not 100% sure if container monitoring will be impacted or not. If not that's fine and can be merged, although it should be explained around the extra mounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants