- running Fedora 26
sudo dnf remove docker-ce and reboot (just in case)
sudo snap install --edge --classic microk8s (also tried --beta and --stable)
microk8s.inspect shows everything ok
microk8s.docker -D -l debug <command> outputs nothing and hangs, no matter what command I try (even --help)
- I see this in the kubelet log:
$ sudo journalctl -u snap.microk8s.daemon-kubelet.service|tail
Oct 16 08:20:44 gogo microk8s.daemon-kubelet[12994]: W1016 08:20:44.727621 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:21:24 gogo microk8s.daemon-kubelet[12994]: W1016 08:21:24.727881 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:22:04 gogo microk8s.daemon-kubelet[12994]: W1016 08:22:04.728205 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:22:44 gogo microk8s.daemon-kubelet[12994]: W1016 08:22:44.728530 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:23:24 gogo microk8s.daemon-kubelet[12994]: W1016 08:23:24.728768 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:24:04 gogo microk8s.daemon-kubelet[12994]: W1016 08:24:04.729119 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:24:44 gogo microk8s.daemon-kubelet[12994]: W1016 08:24:44.729457 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:25:24 gogo microk8s.daemon-kubelet[12994]: W1016 08:25:24.729655 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:26:04 gogo microk8s.daemon-kubelet[12994]: W1016 08:26:04.729875 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
Oct 16 08:26:44 gogo microk8s.daemon-kubelet[12994]: W1016 08:26:44.730078 12994 manager.go:253] Timeout trying to communicate with docker during initialization, will retry
inspection-report-20181016_082316.tar.gz
Nice talking to you face to face @GregoireW .
Indeed the file system with the binaries is read only and I read the labels are filesystem metadata.
I want to see if I can set labels during the build of the snap package. I will have news on this soon.
Hi @akaihola ,
Thank you for reporting this.
Here is what happens. When dockerd starts it listens on a socket (unix:///var/snap/microk8s/current/docker.sock), selinux is blocking socket communication by default as discussed in https://forum.snapcraft.io/t/selinux-blocking-socket-activation-on-fedora/6931 . You can verify this by temporarily disabling selinux and restarting microk8s:
I am taking a look now how/if we can detect selinux and set it to allow the required socket communication.
Thank you for taking the time to report this issue and apologies for any inconvenience.
As MicroK8s is a snap most of the AppArmor and SELinux configuration is taken care by the snapcraft underlying layer. On the MicroK8s side we are working towards a strictly confined snap that would comply with the snapcraft best practices and will take advantage of all the security enhancements offered.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@ktsakalozos It was great to meet you at the cfgmgmt camp.
On this subject, I was about to extract all rules I added on my computer, but I know it is not a good option as every container we will create will need a new set of rules.
I decide to check how docker / containerd was doing on the subject. They have a pre-defined set of rules inside an rpm (
container-selinux) Those are defined in a repo: https://github.com/containers/container-selinux.My idea was first to try to set the selinux container type on the docker in the snap, but unfortunatly I got a small issue: Snap are read only, so the
chcon -t container_runtime_t /snap/microk8s/current/usr/bin/dockerdreturn aread only fserror.Not sure how to test that. It would be cool if installing the snap requires the
container-selinuxRPM then change the type of docker binaries to thecontainer_runtime_t. It would be cooler if it solves every issue 😉I ran this command:
and pasted in the lines from
audit.log(see my long comment above). It created for me the filesmicrok8s.ppandmicrok8s.te. The contents ofmicrok8s.teare:If I run
then microk8s works as described in the README.
I hope this is helpful for enabling support for SELinux enabled systems.