安装完kubelet,并启动后,kubelet init后就直接说kubelet没启动,怎么办

来源:12-3 搭建GitLab CI服务器和Pipeline演示

qq_罗_1

2021-03-06

kubelet.service - kubelet: The Kubernetes Node Agent

Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)

Drop-In: /usr/lib/systemd/system/kubelet.service.d

       └─10-kubeadm.conf

Active: activating (auto-restart) (Result: exit-code) since Thu 2021-03-04 13:40:55 UTC; 464ms ago

 Docs: https://kubernetes.io/docs/

Process: 10210 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=255)

Main PID: 10210 (code=exited, status=255)

Mar 04 13:40:55 k8s-master kubelet[10210]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x4a8d418, 0x4f28b60, 0xc0009fe0f0, 0x1, 0xc0001000c0)

Mar 04 13:40:55 k8s-master kubelet[10210]: /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:167 +0x149

Mar 04 13:40:55 k8s-master kubelet[10210]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x4a8d418, 0x12a05f200, 0x0, 0xc00072df01, 0xc0001000c0)

Mar 04 13:40:55 k8s-master kubelet[10210]: /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x98

Mar 04 13:40:55 k8s-master kubelet[10210]: /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90

Mar 04 13:40:55 k8s-master kubelet[10210]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.Forever(0x4a8d418, 0x12a05f200)

Mar 04 13:40:55 k8s-master kubelet[10210]: /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:81 +0x4f

Mar 04 13:40:55 k8s-master kubelet[10210]: created by k8s.io/kubernetes/vendor/k8s.io/component-base/logs.InitLogs

Mar 04 13:40:55 k8s-master kubelet[10210]: /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/component-base/logs/logs.go:58 +0x8a

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'

下面是翻译

kubelet。service—kubelet: Kubernetes节点代理

加载:加载(/ usr / lib / systemd /系统/ kubelet.service;启用;厂商预设:禁用)

dropin: /usr/lib/systemd/system/kubelet.service.d

└─10-kubeadm.conf

Active:自Thu 2021-03-04 13:40:55 UTC开始激活(自动重启)(Result: exit-code);464毫秒前

/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=255)

主PID: 10210 (code=exited, status=255)

k8s-master kubelet[10210]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait。直到(0x4a8d418, 0x4f28b60, 0xc0009fe0f0, 0x1, 0xc0001000c0)

k8s-master kubelet[10210]: /workspace/src/ k8s.o o/kubernetes/_output/dockerized/go/src/ k8s.o o/kubernetes/vendor/ k8s.o o/apimachinery/pkg/util/wait/wait: 167 + 0 x149

k8s-master kubelet[10210]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait。JitterUntil(0x4a8d418, 0x12a05f200, 0x0, 0xc00072df01, 0xc0001000c0)

k8s-master kubelet[10210]: /workspace/src/ k8s.o o/kubernetes/_output/dockerized/go/src/ k8s.o o/kubernetes/vendor/ k8s.o o/apimachinery/pkg/util/wait/wait: 133 + 0 x98

3月04 13:40:55 k8s-master kubelet[10210]: k8s.o o/kubernetes/vendor/ k8s.o o/apimachinery/pkg/util/wait.Until(…)

3月04日13:40:55 k8s-master kubelet[10210]: /workspace/src/ k8s.o o/kubernetes/_output/dockerized/go/src/ k8s.o o/kubernetes/vendor/ k8s.o o/apimachinery/pkg/util/wait/wait.go:90

k8s-master kubelet[10210]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait。永远(0 x4a8d418 0 x12a05f200)

k8s-master kubelet[10210]: /workspace/src/ k8s.o o/kubernetes/_output/dockerized/go/src/ k8s.o o/kubernetes/vendor/ k8s.o o/apimachinery/pkg/util/wait/wait: 81 + 0 x4f

3月04 13:40:55 k8s-master kubelet[10210]:由k8s.io/kubernetes/vendor/k8s.io/component-base/logs.InitLogs创建

/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/component-base/logs/logs。: 58 + 0 x8a

不幸的是,出现了一个错误:

等待条件超时

此错误可能由以下原因引起:

  • kubelet没有运行

由于节点在某些方面配置错误,kubelet不健康(必需的cgroups被禁用)

如果你在一个系统驱动的系统上,你可以尝试用以下命令来排除错误:

  • ‘systemctl status kubelet’

  • ‘journalctl -xeu kubelet’

此外,在容器运行时启动时,控制面组件可能已经崩溃或退出。

要排除故障,请使用首选的容器运行时命令行列出所有容器。

这里有一个例子,你可以列出所有Kubernetes容器运行在docker:

  • ‘docker ps -a | grep kube | grep -v pause’

一旦你找到了失败的容器,你可以用以下方法检查它的日志:

-“docker logs CONTAINERID”

写回答

1回答

麦兜搞IT

2021-03-15

您好,请问您是用哪种方法搭建的k8s? minikube么,还是kubeadm?请检查kubelet的运行状态先

0
2
麦兜搞IT
回复
qq_罗_1
是minikube么?
2021-03-18
共2条回复

系统学习Docker 践行DevOps理念

无论你是开发、测试还是运维,Docker都是你的必备技能。

3297 学习 · 1895 问题

查看课程