几个月前,我在装有 Ubuntu 18.04 的笔记本电脑上安装了 kubernetes 集群。我玩了一下,然后忘记彻底删除它了
现在我看到很多 kube* 日志,我想摆脱它们:卸载任何与 k8s 相关的服务
Mar 25 08:32:16 alex-TM1701 kubelet[6862]: F0325 08:32:16.474274 6862 server.go:218] unable to load client CA file /var/lib/localkube/certs/ca.crt: open /var/lib/localkube/certs/ca.crt: no such file or directory
Mar 25 08:32:16 alex-TM1701 systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Mar 25 08:32:16 alex-TM1701 systemd[1]: kubelet.service: Failed with result 'exit-code'.
Mar 25 08:32:26 alex-TM1701 systemd[1]: kubelet.service: Service hold-off time over, scheduling restart.
Mar 25 08:32:26 alex-TM1701 systemd[1]: kubelet.service: Scheduled restart job, restart counter is at 52.
Mar 25 08:32:26 alex-TM1701 systemd[1]: Stopped kubelet: The Kubernetes Node Agent.
Mar 25 08:32:26 alex-TM1701 systemd[1]: Started kubelet: The Kubernetes Node Agent.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --pod-manifest-path has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --cluster-domain has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --client-ca-file has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --cadvisor-port has been deprecated, The default will change to 0 (disabled) in 1.12, and the cadvisor port will be removed entirely in 1.13
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --fail-swap-on has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --allow-privileged has been deprecated, will be removed in a future version
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --cluster-dns has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: Flag --authorization-mode has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: I0325 08:32:26.727938 6901 feature_gate.go:226] feature gates: &{{} map[]}
Mar 25 08:32:26 alex-TM1701 kubelet[6901]: F0325 08:32:26.728045 6901 server.go:218] unable to load client CA file /var/lib/localkube/certs/ca.crt: open /var/lib/localkube/certs/ca.crt: no such file or directory
Mar 25 08:32:26 alex-TM1701 systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Mar 25 08:32:26 alex-TM1701 systemd[1]: kubelet.service: Failed with result 'exit-code'.
我试过了,但没有帮助
kubeadm reset
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
sudo apt-get autoremove
sudo rm -rf ~/.kube
答案1
尝试一下这些:-
echo y | sudo kubeadm reset remove-etcd-member
sudo docker stop $(docker ps -a -q)
sudo docker rm $(docker ps -a -q)
sudo docker rmi $(docker images -a -q)
sudo apt purge -y docker-engine docker docker.io docker-ce docker-ce-cli
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce
sudo rm -rf /var/lib/docker /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock
sudo kubectl delete node --all
sudo kubeadm reset
echo y | sudo apt purge kubeadm kubectl kubelet kubernetes-cni kube*
echo y |sudo apt autoremove
sudo rm -rf ~/.kube
sudo rm -Rf $HOME/.kube
sudo rm -Rf /etc/kubernetes/admin.conf $HOME/.kube/config