Kubernetes-错误上传小插曲:等待条件超时 [英] Kubernetes- error uploading crisocket: timed out waiting for the condition

查看:157
本文介绍了Kubernetes-错误上传小插曲:等待条件超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为具有1个主节点和2个工作节点的Kubernetes集群创建模板。我已经安装了所有必备软件,并在主节点上运行了kubeadmn init。但是,当我尝试运行作为初始化命令输出得到的kubeadmn连接时,出现错误。


  [discovery]创建集群信息发现客户端,从 https://10.31.2.33:6443请求信息
[发现]从
请求信息 https://10.31.2.33:6443再次针对固定的
公钥来验证TLS [发现]群集信息签名和内容有效
,并且TLS证书针对固定的根节点进行验证,将使用API​​
服务器 10.31.2.33:6443 ; [发现]与API服务器 10.31.2.33:6443成功建立
连接[kubelet]从 kubelet-config-1.12下载kubelet的
配置。 kube-system名称空间中的ConfigMap
[kubelet]将kubelet配置
写入文件 /var/lib/kubelet/config.yaml中。 [kubelet]编写带有标志的kubelet
环境文件以归档
/var/lib/kubelet/kubeadm-flags.env; [预检]激活
kubelet服务[tlsbootstrap]等待kubelet执行
TLS引导程序... [patchnode]上传CRI套接字信息
/ var / run / dockershim .sock到节点API对象< workernode2>。作为
的注释错误,上传弯钩:超时等待
条件```


在workdernode2上运行此命令之前,我已经进行了一次交换-a。

我能够运行一次联接,但是之后,作为脚本的一部分,我先运行了kubeadmn重置,然后进行了init初始化,并在开始显示的地方加入了几次。


无法弄清楚我在做什么或在哪里出错。


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

解决方案

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

  [kubelet]创建ConfigMap kubelet-config-1.13。在名称空间kube-system中,使用集群
[patchnode]中的kubelet的配置上传CRI Socket信息 /var/run/dockershim.sock。到节点API对象 k8smaster作为注释
[kubelet-check]超过40秒的初始超时。
错误执行阶段upload-config / kubelet:为控制平面节点写Crisocket信息时出错:等待条件

$ b超时$ b

摆脱此问题的步骤:


  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守护进程重新加载$ ​​b
    $ b systemctl重新启动kubelet

    sudo iptables -F&须藤iptables -t nat -F&&须藤iptables -t mangle -F&& sudo iptables -X



  3. 使用以下特殊标记执行初始化操作


    代码:

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

    (其中10.10.10.2是主节点的IP,而192.168.0.0/16是分配给Pods的专用子网)




I am trying to create a template for a Kubernetes cluster having 1 master and 2 worker nodes. I have installed all the pre-req software and have run the kubeadmn init on my master node. But when i try to run the kubeadmn join which i get as an output of the init command i am getting an error.

[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```

I have done a swapoff -a before running this on the workdernode2

I was able to run the join once but after that, as a part of a script, I ran the kubeadmn reset followed by init and join few times where this has started showing up.

Not able to figure out what or where I am doing a mistake.

My main intent is to put all the commands in the form of a shell script (on master node) so that it can be run on a cluster to create a network.

解决方案

I had the encountered the following issue after node was rebooted:

[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

Steps to get rid of this issue:

  1. Check the hostname again, after reboot it might have changed.

    sudo vi /etc/hostname 
    sudo vi /etc/hosts
    

  2. Perform the following clean-up actions

    Code:

    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. Execute the init action with the special tag as below

    Code:

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

    (where 10.10.10.2 is the IP of master node and 192.168.0.0/16 is the private subnet assigned for Pods)

这篇关于Kubernetes-错误上传小插曲:等待条件超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆