我使用kubeadm初始化k8s集群主机,但我感到非常困惑.kubeadm的版本:
# ./kubeadm version kubeadm version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1", GitCommit:"82450d03cb057bab0950214ef122b67c83fb11df", GitTreeState:"clean", BuildDate:"2016-12-14T00:52:01Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
当我运行命令时kubeadm init
,告诉我必须启动kubelet.service:
# ./kubeadm init Running pre-flight checks preflight check errors: kubelet service is not active, please run 'systemctl start kubelet.service'
然后当我重试这个命令后systemctl restart kubelet.service
,告诉我Port 10250 in use
:
# systemctl restart kubelet.service # ./kubeadm init Running pre-flight checks preflight check errors: Port 10250 is in use /var/lib/kubelet is not empty
有没有办法在没有端口的情况下运行kubelet或者我可以更改kubelet的端口吗?
它提到端口正在使用的原因是因为你已经运行kubeadm init
过一次并且它已经改变了很多东西.
kubeadm reset
首先运行以从第一次运行它时撤消所有更改.
然后跑 systemctl restart kubelet
最后,当你运行时,kubeadm init
你应该不再得到错误.
每当kubeadm执行不正确或失败的操作时,都需要重置才能再次正常工作.