gpt4 book ai didi

docker - Kubernetes-上传crisocket : timed out waiting for the condition时出错

转载 作者:IT老高 更新时间:2023-10-28 21:39:59 32 4
gpt4 key购买 nike

我正在尝试为具有 1 个主节点和 2 个工作节点的 Kubernetes 集群创建一个模板。我已经安装了所有 pre-req 软件并在我的主节点上运行了 kubeadmn init。但是,当我尝试运行作为 init 命令输出得到的 kubeadmn join 时,出现错误。

[discovery] Created cluster-info discovery client, requesting info
from "https://10.31.2.33:6443" [discovery] Requesting info from
"https://10.31.2.33:6443" again to validate TLS against the pinned
public key [discovery] Cluster info signature and contents are valid
and TLS certificate validates against pinned roots, will use API
Server "10.31.2.33:6443" [discovery] Successfully established
connection with API Server "10.31.2.33:6443" [kubelet] Downloading
configuration for the kubelet from the "kubelet-config-1.12" ConfigMap
in the kube-system namespace [kubelet] Writing kubelet configuration
to file "/var/lib/kubelet/config.yaml" [kubelet] Writing kubelet
environment file with flags to file
"/var/lib/kubelet/kubeadm-flags.env" [preflight] Activating the
kubelet service [tlsbootstrap] Waiting for the kubelet to perform the
TLS Bootstrap... [patchnode] Uploading the CRI Socket information
"/var/run/dockershim.sock" to the Node API object "<workernode2>" as
an annotation error uploading crisocket: timed out waiting for the
condition```

在 workdernode2 上运行之前,我已经完成了 swapoff -a

我能够运行一次加入,但在那之后,作为脚本的一部分,我运行了 kubeadmn reset 和 init 并加入了几次,这已经开始出现了。

无法弄清楚我在什么地方或哪里做错了。

我的主要意图是将所有命令以 shell 脚本的形式(在主节点上),以便它可以在集群上运行以创建网络。

最佳答案

我在重启节点后遇到了以下问题:

[kubelet] Creating a ConfigMap "kubelet-config-1.13" in namespace kube-system with the configuration for the kubelets in the cluster
[patchnode] Uploading the CRI Socket information "/var/run/dockershim.sock" to the Node API object "k8smaster" as an annotation
[kubelet-check] Initial timeout of 40s passed.
error execution phase upload-config/kubelet: Error writing Crisocket information for the control-plane node: timed out waiting for the condition

解决此问题的步骤:

  1. 再次检查主机名,重启后它可能已更改。

    sudo vi /etc/hostname 
    sudo vi /etc/hosts
  2. 执行以下清理操作

    代码:

    sudo kubeadm reset
    rm -rf /var/lib/cni/
    sudo rm -rf /var/lib/cni/

    systemctl daemon-reload

    systemctl restart kubelet

    sudo iptables -F && sudo iptables -t nat -F && sudo iptables -t mangle -F && sudo iptables -X
  3. 使用下面的特殊标签执行初始化 Action

    代码:

    sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=10.10.10.2 --ignore-preflight-errors=all    

    (其中 10.10.10.2 是主节点的 IP,192.168.0.0/16 是分配给 Pod 的私有(private)子网)

关于docker - Kubernetes-上传crisocket : timed out waiting for the condition时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53525975/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com