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
kubeadm 1.8.0 init fails with "/var/lib/kubelet is not empty" #53356
Comments
CauseThis is related to the location where the kubelet persists its certificates while running in the background, waiting for config:
since Workaroundif you are scripting bootstrapping a known clean machine, there are a few possible workarounds until #53317 is released in 1.8.1 (any of the following work around this issue):
Resolutionaddressed as part of #53317 |
cc @kubernetes/sig-cluster-lifecycle-bugs @luxas |
@wjrogers I did |
On a known clean environment, that's an ok workaround for the moment, but the reason |
(If you wonder why the deployment scripts that you wrote yesterday stopped working this morning – this is why! :-)) For the time being, before running
I'd love to know if there are foreseeable pitfalls in this approach. Thanks! <3 |
apologies for the churn. we traded a data loss issue on reboot for this false-positive fail safe issue. working with @kubernetes/sig-cluster-lifecycle-bugs to determine the best way to resolve this. |
No worries, and thanks for the super-quick turnaround time. Much appreciated! |
This guys are posting new versions without properly testing it. Can you imagine brand new centos 7 installation and then getting: "kubeadm 1.8.0 init fails with "/var/lib/kubelet is not empty" |
Everything was done by: https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ but now it is even getting better: The HTTP call equal to 'curl -sSL http://localhost:10255/healthz' failed with error: Get http://localhost:10255/healthz: dial tcp [::1]:10255: getsockopt: connection refused |
I apologize for the issue. Our top priority was to prevent data loss and issues upgrading existing installations that would disrupt already-running workloads. We are working now to resolve this issue with fresh installations. |
Wish you luck. |
ETA for a fix for this? should i hard code this deletion of contents of /var/lib/kubelet prior to running kubeadm init in my automation scripts? or simply add the ignore pre flight checks arguement will do the trick? |
there are plenty of other pre-flight checks that are valuable and you don't want to skip, it's just the check for an empty if you are scripting bootstrapping a known clean machine, there are a couple possible workarounds until #53317 is released in 1.8.1:
|
ok just to confirm, moving forward, ideally |
Correct. The |
(Reposting my earlier tip since it worked like a charm for my automated deployment scripts.) For the time being, before running
This might or might not be appropriate for your use-cases, but for mine it works great (I'm automatically deploying hundreds of k8s clusters of training purposes). Stopping kubelet is necessary to avoid race conditions where it would recreate the |
@hemaprasad, be sure to follow the instructions to add the admin kubeconfig file so kubectl can communicate with the initialized API server:
|
For anyone following this thread, if you encounter issues other than the |
@liggiit, thank you for your quick response kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')" |
@hemaprasad: you seem to be hitting a totally different problem than the one related to |
@jpetazzo,even I also faced the same issue'var/lib/kubelet is not empty' after I used the command "kubeadm reset && kubeadm init" it want to hanged state.(if want u can see my above threads).to move to another step I'm trying to install the weave it was failed saying that |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add /var/lib/kubelet error to known issues Document #53356 in known issues for 1.8.0
Automatic merge from submit-queue (batch tested with PRs 53317, 52186). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Change default --cert-dir for kubelet to a non-transient location The default kubelet `--cert-dir` location is `/var/run/kubernetes`, which is automatically erased on reboot on many platforms. As of 1.8.0, kubelet TLS bootstrapping and cert rotation now persist files in `--cert-dir`, this should default to a non-transient location. Default it to the `pki` subfolder of the default `--root-dir` Fixes #53288 Additionally, since `kubeadm` expects a running (albeit crashlooping) kubelet prior to running `kubeadm init` or `kubeadm join`, and was using the default `--root-dir` of `/var/lib/kubelet`, it should not expect that folder to be empty as a pre-init check. Fixes #53356 ```release-note kubelet: `--cert-dir` now defaults to `/var/lib/kubelet/pki`, in order to ensure bootstrapped and rotated certificates persist beyond a reboot. ```
pick to 1.8 branch is #53448 |
@hemaprasad if you get My piece of advice would be to destroy the machines that you are currently using and restart from scratch (assuming you are using VMs), making sure that you follow each step carefully. Very often it solved the problem for me, because I had forgotten a step, or deviated from the instructions. Especially if something fails, it is often easier to restart from scratch, until you understand fully the technology and each underlying command. Good luck! |
Hello hemaprasad, |
@vglisin your explanations are correct! As for your dashboard question, I have no idea, but I would recommend to open another github issue for that (since the title of this issue is "kubeadm 1.8.0 init fails with "/var/lib/kubelet is not empty""). Thank you! |
Thank you for fast reply. Also I am trying these innocent commands from documentations: My guess is that is also the same reason why dashboard over proxy is not working. |
@vglisin It looks like you are copying |
Nice this is... so why into same documentation exist this: Never mind, it is obviously long way to go till this function even in test environment :( |
Hello all. That's for today. Hope this will help somebody. |
[MILESTONENOTIFIER] Milestone Issue Needs Approval @liggitt @luxas @mikedanese @pipejakob @wjrogers @kubernetes/sig-cluster-lifecycle-bugs Action required: This issue must have the Issue Labels
|
@jpetazzo I've tried you're workaround
But I'm then on kubeadm init I'm hitting this:
|
this is fixed in v1.8.1 |
After installing 1.8.1 kubelet won't start:
|
Not only what you mentioned dkirrane, there is a problem with: |
If you try with this you will see that there is no way to use IP address mentioned: Where to use mentioned IP address? |
Hello, solved a Token problem. |
This issue is fixed in the latest version of kubernetes. Just reset the kubeadm and remove the /var/lib/etcd as kubeadm is expecting it to be empty. Then start the kubeadm init. |
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
On a fresh Ubuntu 16.04.3 system booted from the official cloud image,
kubeadm init
fails because/var/lib/kubelet
exists.What you expected to happen:
kubeadm successfully initializes the cluster
How to reproduce it (as minimally and precisely as possible):
apt-get install -y apt-transport-https docker.io
kubeadm init
Anything else we need to know?:
Contents of
/var/lib/kubelet
:Environment:
kubectl version
):uname -a
):Linux kubemaster 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: