-
Notifications
You must be signed in to change notification settings - Fork 64
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
Volumes are not forced to use SELinux label #208
Conversation
… each defined volume
@jdoss we had this change being suggested before, but you mentioned in #66 (comment) that this breaks CSI integration. Do you have more details? Is it related to #185? |
I believe this does what #66 does and it moves the SELinux logic up so it applies to all mounts which can have unintended consequences. The better solution would be to add in support for
|
Hi @jdoss, Is volume_mount stanza some new feature? I don't see it in podman driver documentation. Will |
Ah right, thanks @jdoss I think I remember it now. This issue in Nomad has some more details: hashicorp/nomad#9123 @rikislaw |
No problem @lgfa29! |
So finally what approach we should follow to allow podman driver mount some host directory without |
Hi @rikislaw, I think @jdoss is suggesting something like these changes: I haven't tested this much, so I'm not sure if it actually works, but the idea is that you would be able to set these labels at the The implementation I have is fairly naive because it leaves to plugins to handle that config, so we would have to discuss more what a better implementation would be. Possibly a new way to validate if the plugin supports additional label? Not sure 🤔 Would either of you be interested in moving the development of this feature forward? |
Hi @lgfa29 I'm coming back to this issue after some time as it is getting more critical for us. The suggested solution assumes we are using csi or host volumes, but we are not using them. We just use volumes list inside config of podman (previously docker) task. At this moment csi or host volumes are not good for us. Are we 100% sure, that change from this PR will break CSI integration? At which point? Maybe it can be fixed by adding some more changes in section "create binds for host volumes, CSI plkugins, and CSI volumes" ?? BR, |
@rikislaw Yes, I am very confident that if we merge this in it will break CSI for a lot of folks. The better path is the work that @lgfa29 talked about in his last response. If you need a faster fix, I would remove
and then manually manage your mounts in the task section of your nomad jobs with
I think that should work in the short term until we come to consensus on if the addition of Also as a nuclear option, turning off SELinux on your client nodes is something you can do. I don't recommend it. But will unblock you. |
I got some time at lunch to test this with Nomad 1.6.1 and
I set this on a job task.
|
Hi @jdoss, Regarding used versions, I currently work on Generally I was trying not to use Some not perfect workaround would be adding additional option along with BR, |
I also had a case where I need to mount NFS storage into Podman task without the At first I tried using task's Then I tried to remove the driver's The only solution I found was to run the tasks using NFS-storage as privileged, which is obviously not a good solution. There needs to be more control than one global flag. As a user I didn't expect that when the Even if the host volumes would add support for per-volume/mount labels, I think the separate |
The PR to support it is ready, but it requieres a new release from Nomad that includes the new configuration on the volume mount configuration. |
This feature is already implemented and merged into the task driver PR-321 Im going to close this one now. |
SELinux label is not added by default to all volumes/mounts when we specify usage of SELinux label in main Nomad config for Podman driver. This setting goes only to standard Nomad mounts. For volumes defined in job definition, we need to provide z label for each volume, where we want to use it. With previous approach I was not able to mount share, that didn't require providing z label at all. I had this issue on RHEL7/8 with enabled selinux and for NFS mounts. NFS mounts were not working (permission denied) when mounted with z label.