-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Allow configuration of Rootlesskit's CopyUpDirs through an environment variable #10385
Comments
This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 45 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions. |
This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 45 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions. |
Unstale, we can evaluate for 2024-10 |
@ludost can you address PR feedback and rebase your PR? If so we can look at this for the October cycle. |
@ludost I am not able to validate the issue by following the steps mentioned: #10386 (comment) as I see the same behavior on previous versions and master commit, regardless of using the env var
I deployed a simple nginx pod
and also created a local folder I am following these steps to enable k3s-rootless.service on an ubuntu instance: #3636 (comment) Please advice.
|
@mdrahman-suse where are you setting |
I was running the command on the server itself |
I added the env var on
And when I check the logs, I see the var is there
But when I add a file on the container, I am not seeing the file on local shared folder
Any suggestions? @brandond |
But on previous version, I am able to see it working fine, even without setting the new env var 🤷♂️ |
I am not able to verify this issue, can I get some guidance on this? CC @ludost @brandond |
@ludost As I am not able to replicate or validate this change, can you please verify this issue on your end and provide necessary steps, if possible? |
I believe the behaviour you describe is exactly the intended design. Normally with a rootless setup the filesystem is made available to a process namespace. Although the user sees these files as if the user has root rights, any files created will still be owned by the user (and visible outside the namespace). This is a problem for files that normally live in a place where the user has no access, for example in /etc/. So, copy-up creates a copy of those folders that only live in the namespace, where the user can actually create files, etc. But these can't be seen from outside the namespace. So the use-case is: Whenever we want to create a file in a folder that is only available to root, we add it to the environment variable, so the file can then be created. However, after K3S stops, those files are lost. We use it for a very specific case where we are running a modified Flannel setup, which needs write access to "/etc/cni/net.d/" in a rootless environment. |
hi @ludost Thanks for explaining it. So to confirm, the steps to validate this:
Please let me know if I am missing anything or any additional steps is needed |
@mdrahman-suse I'm not entirely sure what would be needed to be tested further. This is a very simple fix to add additional folders to an existing feature that works as advertised. I know that the folder is correctly added when using the environment variable, as I see the expected behavior. |
@mdrahman-suse it sounds like what you saw above is specifically what is wanted, so you can close this out. |
Thanks y'll! I will close out this issue once I verify the other version |
Validated on other branches as well as this branch. Closing this issue |
Is your feature request related to a problem? Please describe.
In our use-case, (see also issue: #10295) we are running a K3S Agent in a Rootless environment at the end-user's own workstation. This works well (enough), but we also want to provide access to the local folders (through e.g. HostPath volume mounts). But the Agent runs inside the rootless namespace, disallowing read/write access to the actual file-system.
Currently the rootless configuration is hardcoded where the CopyUpDirs are concerned. With this issue, I've created a PR that allows the Agent to setup extra "CopyUpDirs" entries, through an environment variable called "K3S_ROOTLESS_COPYUPDIRS". This environment variable can receive a comma-separated list absolute paths, which will be added to the existing list.
Describe the solution you'd like
See the related PR.
Describe alternatives you've considered
Within the context of running rootless I see no alternative to this change. The namespace container is meant specifically to block this kind of access, with the CopyUpDirs parameter the "normal" way of explicitly exposing external folders. We can also consider a more advanced configuration model, but the rest of the rootless package is using environment variables as well for this purpose.
Additional context
The text was updated successfully, but these errors were encountered: