我正在尝试使用kubeadm init在主节点上运行控制平面。我已经在设备上安装了嵌入式Linux,并为kubernetes提供了必要的依赖。现在我已经运行了kubernetes,但我无法初始化控制平面。我拥有的系统:
- 器件为fpga xilinx zcu 102。
- 操作系统为Yocto嵌入式Linux。
- Kubernetes版本,我有:Kubernetes v1.22.2-脏
该系统在公司代理背后。Kubernetes可以访问互联网(它可以进行版本检查)。Docker可以访问互联网(它可以拉取图像)
当我运行kubeadm init
时,我得到以下响应:
The outputs that are prior are here: https://jpst.it/3hI4d
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.
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.
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
To see the stack trace of this error execute with --v=5 or higher
字符串
在这里它告诉我检查kubelet是否健康。当我运行systemctl status kubelet
时,我得到了下面的输出,它显示了kubelet运行。
* kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (8;;file://xilinx-zcu102-20222/lib/systemd/system/kubelet.service/lib/systemd/system/kubelet.service8;;; enabled; vendor preset: en)
Drop-In: /lib/systemd/system/kubelet.service.d
`-8;;file://xilinx-zcu102-20222/lib/systemd/system/kubelet.service.d/10-kubeadm.conf10-kubeadm.conf8;;
Active: active (running) since Tue 2023-07-04 14:59:27 UTC; 11min ago
Docs: 8;;https://kubernetes.io/docs/home/https://kubernetes.io/docs/home/8;;
Main PID: 12765 (kubelet)
Tasks: 17 (limit: 4409)
Memory: 63.7M
CGroup: /system.slice/kubelet.service
`-12765 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --confi...
Jul 04 15:10:56 xilinx-zcu102-20222 kubelet[12765]: E0704 15:10:56.788129 12765 kubelet.go:2407] "Error getting node" err="node \"xilinx-...not found"
Jul 04 15:10:57 xilinx-zcu102-20222 kubelet[12765]: I0704 15:10:57.408216 12765 cni.go:239] "Unable to update cni config" err="no network...cni/net.d"
Jul 04 15:10:57 xilinx-zcu102-20222 kubelet[12765]: E0704 15:10:57.492613 12765 kubelet.go:2407] "Error getting node" err="node \"xilinx-...not found"
Jul 04 15:10:57 xilinx-zcu102-20222 kubelet[12765]: E0704 15:10:57.593367 12765 kubelet.go:2407] "Error getting node" err="node \"xilinx-...not found"
型
here是kubelet的journalctl日志
在这里你还可以看到属于kubernetes的docker容器:
docker ps -a | grep kube | grep -v pause
189a443c96ff 897a9db485af "kube-apiserver --ad…" 30 seconds ago Exited (1) 7 seconds ago k8s_kube-apiserver_kube-a5
53a685514bbc 2252d5eb703b "etcd --advertise-cl…" About a minute ago Exited (1) About a minute ago k8s_etcd_etcd-xilinx-zcu18
cde795979dd8 9894e0c256dc "kube-controller-man…" 58 minutes ago Up 58 minutes k8s_kube-controller-manag2
07ec1fd3ebb8 e06572384d3e "kube-scheduler --au…" 58 minutes ago Up 58 minutes k8s_kube-scheduler_kube-s3
型
现在我看到kubelet不断给出错误:Error getting node
.并且有一个错误Unable to update cni config
。
我已经尝试了this问题中最高评级的解决方案。我的系统中的Journalctl输出与这个问题不同。所以问题也可能是不同的,我不能在互联网上找到解决方案。
我试过关闭交换机,如问题中解释的,但它不起作用:
sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab
型
你能帮帮忙吗
1条答案
按热度按时间oxiaedzo1#
在我清理所有内容并启用Docker和Kubelet服务后,它工作了。
字符串