我正试图在当地设置Kubernetes。
我刚刚运行kubeadm init
,它为我提供了join
命令,但似乎我无法在同一台机器上加入群集。运行提供的join命令会导致:
[preflight] Running pre-flight checks.
[WARNING FileExisting-crictl]: crictl not found in system path
[preflight] Some fatal errors occurred:
[ERROR Port-10250]: Port 10250 is in use
[ERROR DirAvailable--etc-kubernetes-manifests]: /etc/kubernetes/manifests is not empty
[ERROR FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
[ERROR FileAvailable--etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
这可能吗?如果是这样的话?
这是出于生产目的,我知道minikube但是我想调查一下如果没有它就可以实现(需要运行VM的开销更少,我也想象)。
我建议使用kubeadm
来配置主服务器,然后删除导致主服务器不能正常工作的不可调度的污点。如果您需要,为您的未来扩展提供极大的灵活性,并且它是kube comuunity中一个成熟的工具。
我找到了这个项目:https://github.com/vtuson/k8single
https://github.com/vtuson/k8single/blob/e92132a7221930f160959f50f836fa3e7348d36e/kubeform_adm.sh这个脚本以及:
kubectl get no -w --> wait until the master node is ready
kubectl get po --all-namespaces --> check that all pods have come up ok
我设法用上面的方法来解决这个问题。