我正在我的本地PC上设置一个新的Kubernetes设置,具有以下规格。在尝试启动Kubernetes集群时,我遇到了一些问题。需要您的输入。
操作系统版本:Linux server.cent.com 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 3enter code here`0 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Docker版本:Docker version 1.13.1,build 07 f3374/1.13.1
[root@server ~]# rpm -qa |grep -i kube
kubectl-1.13.2-0.x86_64
kubernetes-cni-0.6.0-0.x86_64
kubeadm-1.13.2-0.x86_64
kubelet-1.13.2-0.x86_64
字符串
面临的问题是:
[root@server ~]# kubeadm init --apiserver-advertise-address=192.168.203.154 --pod-network-cidr=10.244.0.0/16
[kubelet-check] Initial timeout of 40s passed.
Unfortunately, an error has occurred:
timed out waiting for the condition
This error is likely caused by:
- The kubelet is not running
- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)
If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
- 'systemctl status kubelet'
- 'journalctl -xeu kubelet'
Additionally, a control plane component may have crashed or exited when started by the container runtime.
To troubleshoot, list all containers using your preferred container runtimes CLI, e.g. docker.
Here is one example how you may list all Kubernetes containers running in docker:
- 'docker ps -a | grep kube | grep -v pause'
Once you have found the failing container, you can inspect its logs with:
- 'docker logs CONTAINERID'
error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
型
Kubelet状态:
Jan 29 09:34:09 server.cent.com kubelet[10994]: E0129 09:34:09.354902 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:09 server.cent.com kubelet[10994]: E0129 09:34:09.456166 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:09 server.cent.com kubelet[10994]: E0129 09:34:09.558500 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:09 server.cent.com kubelet[10994]: E0129 09:34:09.660833 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:09 server.cent.com kubelet[10994]: E0129 09:34:09.763840 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:09 server.cent.com kubelet[10994]: E0129 09:34:09.867118 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:09 server.cent.com kubelet[10994]: E0129 09:34:09.968783 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:10 server.cent.com kubelet[10994]: E0129 09:34:10.071722 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:10 server.cent.com kubelet[10994]: E0129 09:34:10.173396 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:10 server.cent.com kubelet[10994]: E0129 09:34:10.274892 10994 kubelet.go:2266] node "server.cent.com" not found
Jan 29 09:34:10 server.cent.com kubelet[10994]: E0129 09:34:10.292021 10994 reflector.go:134] k8s.io/kubernetes/pkg/kubelet/config/apiserver.go:47: Failed to list *v1.Pod: Get https://192
Jan 29 09:34:10 server.cent.com kubelet[10994]: E0129 09:34:10.328447 10994 reflector.go:134] k8s.io/kubernetes/pkg/kubelet/kubeenter code herelet.go:453: Failed to list *v1.Node: Get https://192.168.20?
Jan 29 09:34:10 server.cent.com kubelet[10994]: E0129 09:34:10.3` `29742 10994 reflector.go:134] k8s.io/kubernetes/pkg/kubelet/kubelet.go:444: Failed to list *v1.Service: Get https://192.168
Jan 29 09:34:10 server.cent.com kubelet[10994]: E0129 09:34:10.376238 10994 kubelet.go:2266] node "server.cent.com" not found
型
我在所有这些版本中尝试了相同的方法,但问题相同:1.13.2,1.12.0,1.11.0,1.10.0和1.9.0
3条答案
按热度按时间hgqdbh6s1#
我在Fedora Core OS上安装k8s时遇到了这个问题。
字符串
参见:https://kubernetes.io/docs/setup/production-environment/container-runtimes/
然后docker重启失败,我通过创建一个新文件/etc/systemd/system/docker.service.d/docker.conf来克服这个问题,其中包含以下内容
型
参见:https://docs.docker.com/config/daemon/
在那之后,一切都很好,能够设置k8s集群。
t9aqgxwy2#
根据您的输出,似乎
kubelet
服务无法建立到Kubernetes API服务器的连接,因此在安装过程中没有通过健康检查。原因可能不同,但我建议擦除您当前的kubeadm
设置并从头开始安装,您可以在类似的情况下找到很好的教程,或者你甚至可以按照官方的Kubernetes kubeadm安装guidelines。出于调查目的,您可以使用Kubeadm Troubleshooting guide。
如果您对安装步骤或任何其他相关问题有任何疑问,请在此答案下方写下评论。
q5iwbnjs3#
我也遇到了同样的问题,经过努力,我发现我在kubeadm配置文件中放置了错误的apis服务器端点(也可以通过kubeadm init中的--apiserver-advert-address传递),这与ip addr(在ens 4中)命令的输出不同。我不得不重置kubeadm,然后添加正确的api服务器端点。它工作了。