Hi,All
现在安装kubernetes的过程中,执行了 kubeadm init --config kubernetes.con 命令,但是会卡在以下步骤很久
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[kubelet-check] Initial timeout of 40s passed.
一段时间以后,则提示:
[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.
Here is one example how you may list all running Kubernetes containers by using crictl:
- 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock ps -a | grep kube | grep -v pause'
Once you have found the failing container, you can inspect its logs with:
- 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock 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启动状态正常,但是没有创建任何pod.
我查看了kubelet的输出:
root@liu:~# journalctl -xeu kubelet
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.219217 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.319692 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.421955 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.522388 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.622747 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.723278 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.824200 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:12 liu kubelet[13416]: E1102 08:37:12.924880 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.026091 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.126360 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.226774 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.328200 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.430352 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.530943 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.570572 13416 remote_runtime.go:222] "RunP>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.570912 13416 kuberuntime_sandbox.go:71] ">
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.571099 13416 kuberuntime_manager.go:772] >
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.571291 13416 pod_workers.go:965] "Error s>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.631922 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.734368 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.835740 13416 kubelet.go:2448] "Error gett>
Nov 02 08:37:13 liu kubelet[13416]: E1102 08:37:13.938206 13416 kubelet.go:2448] "Error gett>
ESCOC
:12.219217 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:12.319692 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:12.421955 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:12.522388 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:12.622747 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:12.723278 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:12.824200 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:12.924880 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.026091 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.126360 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.226774 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.328200 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.430352 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.530943 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.570572 13416 remote_runtime.go:222] "RunPodSandbox from runtime service failed" err="rpc>
:13.570912 13416 kuberuntime_sandbox.go:71] "Failed to create sandbox for pod" err="rpc erro>
:13.571099 13416 kuberuntime_manager.go:772] "CreatePodSandbox for pod failed" err="rpc erro>
:13.571291 13416 pod_workers.go:965] "Error syncing pod, skipping" err="failed to \"CreatePo>
:13.631922 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.734368 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.835740 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
:13.938206 13416 kubelet.go:2448] "Error getting node" err="node \"master\" not found"
ESCOC
其中,master是我的kubernetes.conf中所填写的name的名字.同时已经添加了hosts解析.
我所使用的cri 为containerd ,版本为v1.6.9
root@liu:~# ctr -v
ctr github.com/containerd/containerd v1.6.9
我的kubectl等组件版本都是1.25.3
root@liu:~# kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.3", GitCommit:"434bfd82814af038ad94d62ebe59b133fcb50506", GitTreeState:"clean", BuildDate:"2022-10-12T10:57:26Z", GoVersion:"go1.19.2", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
The connection to the server localhost:8080 was refused - did you specify the right host or port?
同时尝试过修改containerd的配置,先/etc/containerd/config.toml配置如下:
# Copyright 2018-2022 Docker Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#disabled_plugins = ["cri"]
disabled_plugins = []
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "registry.aliyuncs.com/google_containers/pause:3.2"
version = 2
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "crun"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
# crun: https://github.com/containers/crun
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.crun]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.crun.options]
BinaryName = "/usr/local/bin/crun"
# gVisor: https://gvisor.dev/
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.gvisor]
runtime_type = "io.containerd.runsc.v1"
# Kata Containers: https://katacontainers.io/
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata]
runtime_type = "io.containerd.kata.v2"
#root = "/var/lib/containerd"
#state = "/run/containerd"
#subreaper = true
#oom_score = 0
#[grpc]
# address = "/run/containerd/containerd.sock"
# uid = 0
# gid = 0
#[debug]
# address = "/run/containerd/debug.sock"
# uid = 0
# gid = 0
# level = "info"
我的系统为Ubuntu 22版本.
root@liu:~# uname -a
Linux liu 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
我该怎么才能成功初始化集群?如能提供思路或者方案不胜感激
你这一堆报错,叫启动正常吗。。。😂
所以人家才提醒你:
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)
先明确服务是否真的正常。再来搞后续
主节点没找到,是不是开了防火墙了?