Skip to content
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

(Weave) Kubeadm reset on node not restoring initial state. #255

Closed
cheburakshu opened this issue Apr 24, 2017 · 7 comments
Closed

(Weave) Kubeadm reset on node not restoring initial state. #255

cheburakshu opened this issue Apr 24, 2017 · 7 comments

Comments

@cheburakshu
Copy link

I used kubeadm join with token and ip address of master.
Immediately I had to reset it.
But, kubeadm does not delete the weave network.

FYI - I did not install weave on node. I installed only on master as per the kubeadm install guide.

How to recover the node?

root@ip-172-20-0-207:~# kubeadm reset
[preflight] Running pre-flight checks
[reset] Stopping the kubelet service
[reset] Unmounting mounted directories in "/var/lib/kubelet"
[reset] Removing kubernetes-managed containers
[reset] No etcd manifest found in "/etc/kubernetes/manifests/etcd.yaml", assuming external etcd.
[reset] Deleting contents of stateful directories: [/var/lib/kubelet /etc/cni/net.d]
[reset] Deleting contents of config directories: [/etc/kubernetes/manifests /etc/kubernetes/pki]
[reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
root@ip-172-20-0-207:~# ifconfig weave
weave     Link encap:Ethernet  HWaddr 06:26:f0:aa:3b:39  
          inet addr:10.40.0.0  Bcast:0.0.0.0  Mask:255.240.0.0
          inet6 addr: fe80::426:f0ff:feaa:3b39/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1376  Metric:1
          RX packets:48 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3044 (3.0 KB)  TX bytes:690 (690.0 B)

root@ip-172-20-0-207:~# 
@coeki
Copy link

coeki commented Apr 25, 2017

@cheburakshu you can just clean up the docker instances eg docker rm $(docker ps -a -q)

But ideally before you reset, you would delete all deployments. But even then, probably still some traces will linger around in mount points on the host (eg /etc/, /var/lib/ depending on the specific deployment).

A bug related to this was opened kubernetes/kubernetes#44911

@cheburakshu
Copy link
Author

@coeki I raised a bug on weavenet for which he opened it on kubernetes. Please see - weaveworks/weave#2911 referenced in #44911.

@coeki
Copy link

coeki commented Apr 27, 2017

@cheburakshu My bad, didn't read the issue 44911 well.

But after reading a bit through that issue, and related issues, the question arises if this is a kubeadm reset related issue. Cause it seems that it's more a general problem of kubernetes, in handling a graceful shutdown/delete/error of pods and/or nodes/deployments, and what they are doing to a node/host.

As @bboreham pointed out, there's no good way to clean up stuff done to the node/host after deletion of a deployment/daemonset, as pointed out in kubernetes/kubernetes#35183.

I'm not sure if kubeadm reset would/should be responsible for all components added to a kubernetes cluster created with kubeadm functionality, as it is meant IIUC, to clean up kubeadm core components (oops on core ;) ), and as mentioned clearing out the link to what plugin was used, but not cleaning up what that plugin did.

Maybe kubeadm reset in the docs should explain this better. Or functionality added to kubeadm to delete any deployments first, before deleting the cluster. But deployments added after setting up the cluster, would in it's turn depend on the behavior of kubernetes/plugins itself to handle that better, so kubeadm reset can use that.

It seems like a loop, but depends on what the responsibilities of what kubeadm reset should be.

cc @jbeda @luxas

@timothysc
Copy link
Member

/cc @klizhentas

@timothysc
Copy link
Member

xref: https://github.com/kubernetes/community/pull/483/files seems like the proper way the system should behave and it's not a kubeadm issue, but we should definitely document the cleanup process.

@bboreham
Copy link

FWIW, I believe kubernetes/community#541 is a better match for 98% of the problem wrt Weave Net: we can clean up in preStop if we know it's forever.

The other 2% of the problem is things like "the pod already died when you're trying to delete it", and I'm not sure there is any complete solution in that scenario.

@timothysc timothysc changed the title Kubeadm reset on node not restoring initial state. (Weave) Kubeadm reset on node not restoring initial state. May 25, 2017
@timothysc
Copy link
Member

So I'm going to close this one as it's not really kubeadm so much as the kubelet and weave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants