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

kubeadm reset does not warn if it cannot delete folders #1914

Closed
neolit123 opened this issue Nov 13, 2019 · 1 comment · Fixed by kubernetes/kubernetes#85265
Closed

kubeadm reset does not warn if it cannot delete folders #1914

neolit123 opened this issue Nov 13, 2019 · 1 comment · Fixed by kubernetes/kubernetes#85265
Assignees
Labels
area/UX kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone

Comments

@neolit123
Copy link
Member

as per @vikramkhatri's comment it seems if kubelet reset cannot delete a folder it does not show any warnings about that and can create complications for the user setup.

this is confirmed as a problem in 1.15, but we need to check what is the state in later versions.

#1587 (comment)

I was able to scroll up and get the output for kubeadm reset when this directory was there. It did not show a warning for not able to delete a file or a directory.

# kubeadm reset
[reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
[reset] Are you sure you want to proceed? [y/N]: y
[preflight] Running pre-flight checks
W1113 09:56:37.221105  130278 removeetcdmember.go:79] [reset] No kubeadm config, using etcd pod spec to get data directory
[reset] No etcd config found. Assuming external etcd
[reset] Please, manually reset etcd to prevent further issues
[reset] Stopping the kubelet service
[reset] Unmounting mounted directories in "/var/lib/kubelet"
[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/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
[reset] Deleting contents of stateful directories: [/var/lib/kubelet /etc/cni/net.d /var/lib/dockershim /var/run/kubernetes]

The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually.
For example:
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X

If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.

The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.

After above:

# ls -l /var/lib/kubelet/
total 32
-rw-r--r-- 1 root root 1744 Nov 13 10:01 config.yaml
-rw------- 1 root root   62 Oct  3 15:49 cpu_manager_state
drwxr-xr-x 2 root root 4096 Nov 13 10:01 device-plugins
drwxr-xr-x 2 root root 4096 Oct  3 15:49 pki
drwx------ 2 root root 4096 Oct  3 15:49 plugin-containers
drwxr-x--- 3 root root 4096 Nov 12 13:35 plugins
drwxr-x--- 2 root root 4096 Oct  4 12:51 plugins_registry
drwxr-x--- 4 root root 4096 Nov 12 13:31 pods
[root@e4n1-g ~]# rm -fr /var/lib/kubelet
rm: cannot remove ‘/var/lib/kubelet/pods/f5d42183-0eb2-433c-9feb-0e531dbd28ef/volumes/kubernetes.io~csi/pvc-6a8ccb7a-7262-41cf-9c28-5e2e59755445/mount’: Operation not permitted
rm: cannot remove ‘/var/lib/kubelet/pods/a104a67d-cca8-442d-a19d-ea29c1df4185/volumes/kubernetes.io~csi/pvc-e7897257-cca6-45da-a46b-8eab54cb13dc/mount’: Operation not permitted
rm: cannot remove ‘/var/lib/kubelet/pods/a104a67d-cca8-442d-a19d-ea29c1df4185/volumes/kubernetes.io~csi/pvc-11a62da0-cbf9-4d5c-8978-acbedd2d96a4/mount’: Operation not permitted
[root@e4n1-g ~]# ls -l /var/lib/kubelet/
total 4
drwxr-x--- 4 root root 4096 Nov 12 13:31 pods
@neolit123 neolit123 added kind/bug Categorizes issue or PR as related to a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. area/UX labels Nov 13, 2019
@neolit123 neolit123 added this to the v1.17 milestone Nov 13, 2019
@SataQiu
Copy link
Member

SataQiu commented Nov 14, 2019

/assign
/remove-help

@k8s-ci-robot k8s-ci-robot removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Nov 14, 2019
@neolit123 neolit123 modified the milestones: v1.17, v1.18 Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/UX kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants