k8s 节点扩容
k8s 节点扩容
对于已经存在的集群,想要扩容,将一个新的node假如集群需要在master上运行以下命令,生成token
sudo kubeadm token create --print-join-command
然后在想要假如的node上运行
sudo kubeadm join
假如新加入的node存在以下问题
则在此node上执行
kubeadm reset
systemctl stop kubelet
systemctl stop docker
rm -rf /var/lib/cni/
rm -rf /var/lib/kubelet/*
rm -rf /etc/cni/
ip link delete cni0
ip link delete flannel.1
systemctl restart kubelet
systemctl restart docker
注意 并运行一下命令
sudo mkdir ~/.kube
sudo cp /etc/kubernetes/admin.conf ~/.kube/
cd ~/.kube
sudo mv admin.conf config
sudo service kubelet restart