k8s搭建步骤及卸载
参考文档:
https://www.yuque.com/docs/share/314371a1-07de-4f7b-8e2a-16fbc42176b6?#
不执行最后【网络插件配置】步骤
补充执行:
yum install -y wget
swapoff -a
配置flannel
mkdir -p /usr/local/install-k8s/plugin/flannel
cd /usr/local/install-k8s/plugin/flannel
wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl create -f kube-flannel.yml
查看会变成ready状态
[root@k8s-master ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready control-plane,master 28h v1.21.2
k8s-node1 Ready <none> 28h v1.21.2
卸载:
kubeadm reset
yum erase -y kubelet kubectl kubeadm kubernetes-cni
ps -ef|grep ku
查看有没有kubelet进程,如果有的话就KILL掉。
再停掉所有docker ,删除容器和镜像。