-
Notifications
You must be signed in to change notification settings - Fork 40.4k
kubeadm doesn't start due to /var/lib/kubelet #37063
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
Comments
cc @dgoodwin |
Did you install kubelet and kubeadm via the official CentOS 7 rpms? It carries an important systemd drop-in that configures kubelet to crash-loop until it's configuration is written. If this is not in place, kubelet starts and creates /var/lib/kubelet, and isn't running in the correct mode for kubeadm. First guess is this is a manually setup kubeadm env perhaps? Come to think of it we should preflight check that kubelet is not fully running, or the systemd drop-in exists. |
I followed http://kubernetes.io/docs/getting-started-guides/kubeadm/:
… after a fresh RHEL7 install. |
Ok I will try to reproduce ASAP, if possible would love to see the "systemctl status kubelet". |
@bronger can you confirm your version of kubeadm/kubelet? I am unable to reproduce. Well /var/lib/kubelet exists as soon as the rpms are installed, but this is ok, it just has to be empty. The pre-flight checks should be ok with this.
Pre-flight checks pass on kubeadm init, as well as join. Will need more info here, please show output from the above commands, exact error you got and command you ran to get it, contents of /var/lib/kubelet, and systemctl status kubelet. |
I can check in 12h. |
The following is in The versions:
|
I am seeing the same thing on Ubuntu Xenial. I am deploying my kube cluster with terraform, and seeing this behaviour once in a while. Outcome is not consistent.
For now my workaround is to
before running |
@bronger systemctl status kubelet if you get a chance. From your gist however it is very clear that kubeadm init has been run on this system already, can you confirm if there were previous or failed attempts to kubeadm init before you run this, or was the system completely clean? Are you using kubeadm reset between attempts? |
Additionally, if anyone could capture output from apt-get install when this happens it would be helpful. I'm suspecting folks are being bitten by the automatic starting of services when package is installed in the .deb's. kubeadm deb should drop that systemd drop-in to make kubelet crash loop and wait for config, but I suspect it's not happening transactionally and kubelet might in some cases try to start itself before that kubeadm systemd drop-in is written to disk, so kubelet starts normally. This theory isn't perfect because in @bronger 's output above we can be certain that kubeadm init was literally run, the secrets and such are all present, so hopefully this is just a result of running kubeadm init multiple times. I can't imagine the .deb's are automatically running kubeadm init. So for anyone who sees this, grab the output from your apt-get install command, and list the contents of /var/lib/kubelet when this happens please! CC @mikedanese @errordeveloper for their experience with the .debs. |
In my case I am definitely not running any After the package installation, I have the two empty I've put all of the terraform output log in a gist here (sorry for the lengthly log): https://gist.github.com/lesaux/0c480bab173eee71203162a725f90e9d#file-apt-get-install-journalctl-n-200 I am just creating a network, a bastion host, and four instances in openstack, using a Xenial cloud image. In this example you can see that kubelet started on all four nodes and thus the |
Thanks @lesaux However kubeadm appears to already be unpacked and installed earlier in the logs. This section is pretty interesting:
Kubelet starts once, fully, a suspicious systemd reload, then it stops it and starts again, this time it sees our kubeadm drop-in and goes into the crash loop we expect for kubeadm usage. When user actually goes to run kubeadm, /var/lib/kubelet isn't empty because it was fully started once already. Something's not right with the .deb's I think, it appears kubeadm is installed in correct order but perhaps the systemd drop-in isn't loaded yet, is there a missing daemon-reload or equivalent in the packaging scripts? |
Please don't put any more effort into this. I still have not found the root cause but it is not |
@bronger ok good that explains the existence of the secrets and such, thanks for the update. However there is definitely something up here, this has been reported by multiple people and I believe is demonstrated clearly in the gist above. |
The problem was the following:
We return to the old snapshot with |
@mikedanese Please move this issue |
Hey, I met same problem. cat < /etc/yum.repos.d/kubernetes.repo[kubernetes] setenforce 0yum install -y docker kubelet kubeadm kubectl kubernetes-cnisystemctl enable docker && systemctl start dockersystemctl enable kubelet && systemctl start kubeletProblem: kubelet.service don't start. But when use cmdline " systemctl start kubelet", it don't give some warnings or errors Jan 05 05:00:07 master.redhat.com systemd[1]: kubelet.service: main process exite...E I check the log: Version available if needed: |
@kenzhaoyihui This is totally by design and isn't related to the issue above. |
@luxas Thank for your explanation. I will try again. That is a strange design, what is the purpose of this? Could you explain it for me? Thanks in advance! |
so, does the solution be |
I have similar issue kubelet service is exiting for some reason: Apr 20 07:30:45 ip-172-23-12-94.ap-south-1.compute.internal systemd[1]: kubelet.service: main process exited, code=exited, status=1/FAILURE Apr 20 07:30:45 ip-172-23-12-94.ap-south-1.compute.internal systemd[1]: kubelet.service: main process exited, code=exited, status=1/FAILURE Server: CENTOS_MANTISBT_PROJECT="CentOS-7" |
@mnnit-geek please see kubernetes/release#306 |
I think we can/should move the conversation to kubernetes/kubeadm#262 in case this problem still exists. |
please switchoff your swap memory i faced same problem and when i remove swap entry from my /etc/fstab file .then it worked in my case.also do swapoff |
I am also facing same issue with kubelet on cento7 @awesomemayank007 I have done same settings on machine but it isn't work. [root@master1 ~]# systemctl status kubelet Nov 16 08:29:00 master1.com systemd[1]: kubelet.service: main process exited, code=exited, status=1/FAILURE |
@sachinar Please don't comment on closed issues, but instead open a new issue in kubernetes/kubeadm with sufficient details |
#yum install -y kubelet kubeadm kubectl docker |
Thanks Arunm8489 ,, its works for me as well.. |
Amongst the pre-flight checks of
kubeadm
is a check that/var/lib/kubelet
does not exist. However, when I follow the instructions on http://kubernetes.io/docs/getting-started-guides/kubeadm/ for CentOS 7, using RHEL 7, right after the commandsthe directory
/var/lib/kubelet
comes into existence. This does not happen every time, actually it is quite rare, so it is probably due to a race.The text was updated successfully, but these errors were encountered: