-
Notifications
You must be signed in to change notification settings - Fork 594
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
KubeVirt does not work with Talos Linux 1.9 #10083
Comments
talos 1.9 has only selinux compiled and not even enabled at all, this is rather a an upstream issue on how they check if selinux is enabled |
Hey @frezbo, Selinux is enabled, but in
|
I just found similar issue in KubeVirt project |
but just having selinux fs mounted doesn;t mean it's enabled at all, you still need
Talos doesn't do anything in this regard, it probably kubevirt trying to access |
@dsseng tagging you here just to make sure we don't do anything wrong |
True. Mere existence of SELinux filesystem should not decline any permissions. I will take a look at what KubeVirt does and whether or not SELinux could affect that in disabled mode but with selinuxfs, maybe if that's the case we should mount selinuxfs conditionally. |
Okay I found workaround: apiVersion: apps/v1
kind: DaemonSet
metadata:
name: disable-selinux
namespace: cozy-kubevirt
labels:
app: disable-selinux
spec:
selector:
matchLabels:
app: disable-selinux
template:
metadata:
labels:
app: disable-selinux
spec:
containers:
- command:
- sh
- -exc
- test -f /host/sys/fs/selinux/enforce && mount -t tmpfs tmpfs /host/sys/fs/selinux || sleep infinity
image: docker.io/library/alpine
name: mount
securityContext:
privileged: true
volumeMounts:
- mountPath: /host
mountPropagation: Bidirectional
name: host-root
hostIPC: true
hostNetwork: true
hostPID: true
tolerations:
- operator: Exists
volumes:
- hostPath:
path: /
name: host-root |
So okay, this means kubevirt breaks with selinuxfs mounted but policy not loaded. As I see from its code, it uses conventional Linux methods for querying SELinux (like getenforce from the container), which seem to interpret From our side the fix should be not mounting selinuxfs when not enabling SELinux. This is what I am going to do right now. This change will likely be backported to 1.9 and released with the next point release. |
I also think upstream should do a better check |
It also should. But actually mounting selinuxfs is not necessary and takes some time, even minor, so perhaps we better mount it conditionally. |
Having selinuxfs mounted might confuse some software, as conventional Linux systems do not have selinuxfs mounted when SELinux is disabled and no policy is loaded. Fixes siderolabs#10083 Signed-off-by: Dmitry Sharshakov <[email protected]>
Having selinuxfs mounted might confuse some software, as conventional Linux systems do not have selinuxfs mounted when SELinux is disabled and no policy is loaded. Fixes siderolabs#10083 Signed-off-by: Dmitry Sharshakov <[email protected]>
Having selinuxfs mounted might confuse some software, as conventional Linux systems do not have selinuxfs mounted when SELinux is disabled and no policy is loaded. Fixes siderolabs#10083 Signed-off-by: Dmitry Sharshakov <[email protected]> (cherry picked from commit ae6d065)
Bug Report
Description
Logs
virt-handler reports an error during VM creation:
this is happening because of selinux enabled:
code:
Environment
I tried to disable selinux using machineconfig:
and
and running
talosctl upgrade
commad, but it had no effectTalos Linux 1.8 have no
/sys/fs/selinux/enforce
so this check returns false:The text was updated successfully, but these errors were encountered: