-
Notifications
You must be signed in to change notification settings - Fork 715
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
1.6.0 broke selinux again #215
Comments
Not able to reproduce immediately with a fully up to date CentOS 7 vm, how does this compare to your environment @coeki?
kubeadm init completed successfully for me and no denials in audit.log. |
@dgoodwin Sorry, since I use vagrant, and some ansible, that particular environment is long gone, which was based on the just released kubeadm/kubernetes 1.6.0 (not alpha). I have tested it just now with a fresh environment, an updated centos7, and kubeadm/kubernetes 1.6.1, and can confirm it works with So I'll close this one out, it must have been a fluke. Thanks for having a look. |
Hi @dgoodwin So I refactored my vagrant dev pipeline, and it broke on fedora 25 (updated specs below), which is weird since the rpm's are build on fedora. Tested with weave plugin. centos/7 (updated):
fedora 25 (updated):
docker inspect on Centos/7:
on fedora 25:
|
I can understand the frustration as this has seemingly broke out from underneath us several times now, but first lets clarify exactly what broke? Are there denials in /var/log/audit/audit.log? Are there any other errors in docker's journald? What containers were running at the time? (docker ps) Were any containers failing, (docker ps -a) and if so, what was in their docker logs? I tried to reproduce:
It may be worth noting Fedora is not listed on this getting started guide, I know when we created the rpms we discussed that as far as we knew, they should work on Fedora, but CentOS was definitely considered the more useful target. You will probably have a smoother experience there, but we can still try to keep Fedora operational. For my test I did find kube-apiserver pod crashing, and the following in audit.log:
All other pods seem to come up so this would appear to be a relatively isolated issue with the new certs. |
@dgoodwin, I'm sorry for my rant, I admit I was frustrated, cause last time I tested it on fedora/25-cloud-base, it seemed to work. But this was in one of the 1.6.alpha releases, where I build the binaries myself. I know Fedora is officially not supported, but well centos and fedora having worked smiliar in the past, I still run it. Probably something changed policy wise, at least the selinux labels differ between centos/7 and fedora/25, which might be the issue. So I did some more investigations and trying to piece it together. Fedora/25 uses the newer scheme of BTW I'm seeing the same avc's for kube-apiserver on fedora/25:
After some tries the kube-apiserver dies, not even running in docker. Now if I manually adjust the manifest for kube-apiserver and add:
It runs the kube-apiserver, but if the edit was not quick enough, you might have to restart kubelet. Now it works with setenforce 1. This also affects kube-controller-manager.
Fixed that manifest like kube-apiserver and then the cluster runs again. So I can't put my finger on it. So what is broken? That remains a good point. Thanks for your patience ;) |
Not a problem, it is frustrating keeping this functional. I'm not great with selinux but this is good info above, I will try to find some time to debug soon. We could perhaps just go spc_t for the apiserver it's just unfortunate to have to open that one up as well. (we do this for etcd so it can write to host disk, but thus far that was it) |
@dgoodwin I found the root cause in Fedora 25, it's the fact that process type This post from @rhatdan explains a tightening of the container_selinux policy: Some diff between fedora and centos: Fedora:
Centos:
If the fedora container_selinux policy would be mainstream for centos/rhel as well, docker just mounting a directory on the host as a volume with read-only permissions, would still be blocked, if it's not (re)labeled And then there is something I found, but did not test:
So, I'm kinda stuck, couple of solutions as far as I can see are:
Any thoughts? |
Really good info, thanks! spc_t would be the quick and easy path forward, quite an easy change and precedent already there for etcd pod. Certs injected as secrets or configmaps would likely be the ideal solution. |
container_auth_t is a context assigned to docker authorization plugins, not to container processes. |
Simplest case is to run as spc_t, but we need to make it easier to extend the SELinux policy for container processes to add these types of rules. I will take a quick look at doing this. |
As it stands this only affects Fedora25, but as we seen before, it could trickle down to Centos7. The fix should be trivial, as we just need to add I would like to try and see if I can make a PR, but since I have never done it before, I'll have to setup some stuff. |
@coeki A PR from you fixing that would be awesome! Contact me privately on Slack in case you run into errors when creating your dev env. |
@coeki Are you working on this? Would be awesome to get this fixed. We now store PKI assets as secrets for self-hosted clusters (see kubernetes/kubernetes#50766), so hopefully that should also fix some of this. |
@luxas still an issue? |
I think we can close due to inactivity. |
BUG REPORT
Versions
kubeadm version (use
kubeadm version
):kubeadm version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.0", GitCommit:"fff5156092b56e6bd60fff75aad4dc9de6b6ef37", GitTreeState:"clean", BuildDate:"2017-03-28T16:24:30Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Environment:
kubectl version
):What happened?
On the master, where you run kubeadm init, setenforce 0 is still needed as it will be denied to read the certs.
ausearch -m avc
What you expected to happen?
Seems similar to #107, and expected to run with setenforce 1
How to reproduce it (as minimally and precisely as possible)?
Every time
Anything else we need to know?
The text was updated successfully, but these errors were encountered: