如何使用单个计算机作为主服务器和节点运行Kubernetes集群?

时间:2018-03-05 21:58:33

标签: kubernetes kubectl

我正在尝试在本地设置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的开销更少)。

2 个答案:

答案 0 :(得分:4)

我建议使用kubeadm配置主服务器,然后删除导致主服务器无法为正常工作负载调度的污点。如果您需要,为您的未来扩展提供极大的灵活性,并且它是kube社区中一个成熟的工具。

答案 1 :(得分:1)

我找到了这个项目: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

我设法用上面的方法来解决这个问题。

相关问题