Weave Kubernetes中的就绪探测失败错误

myss37ts  于 5个月前  发布在  Kubernetes
关注(0)|答案(2)|浏览(62)

我有一个集群,在Raspberry pi上有10个工作节点,主节点在Ubuntu 16.04上运行。一切似乎都很好,但有时在节点上运行的Pod显示以下错误:
Warning FailedCreatePodSandBox 18m (x3 over 18m) kubelet, w188 (combined from similar events): Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "6fa511fb1d292702aa99318b785f5011307601868ff2520c542515a239924c16" network for pod "deployment-6w24f": NetworkPlugin cni failed to set up pod "deployment-6w24f_aps-namespace" network: unable to allocate IP address: Post http://127.0.0.1:6784/ip/6fa511fb1d292702aa99318b785f5011307601868ff2520c542515a239924c16: dial tcp 127.0.0.1:6784: connect: connection refused
我正在使用weave进行网络连接,它在kube dashboard上显示以下错误:
Readiness probe failed: Get http://127.0.0.1:6784/status: dial tcp 127.0.0.1:6784: connect: connection refused Back-off restarting failed container MountVolume.SetUp failed for volume "weave-net-token-txqhk" : couldn't propagate object cache: timed out waiting for the condition
该节点显示此错误,一段时间后,它开始自动正常工作。这是不时发生的多个节点。我使用下面的命令初始化集群和编织:

sudo kubeadm init --token-ttl=0 --apiserver-advertise-address=192.168.8.12

kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

字符串
有没有人可以指导我如何解决这个问题。

o3imoua4

o3imoua41#

对我有效的方法是使用我的kube-dns服务的IP范围添加iptable规则。

# kubectl get svc -n kube-system 
NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   16m
[root@master kubernetes]#

字符串
由于kube-dns的IP是10.96.0.10,那么iptable规则的有效范围将是10.96.0.1/32

# iptables -t nat -I KUBE-SERVICES -d 10.96.0.1/32 -p tcp -m comment --comment "default/kubernetes:https cluster IP" -m tcp --dport 443 -j KUBE-MARK-MASQ


关于这个问题的更多信息可以在here中找到。

nzkunb0c

nzkunb0c2#

在我的情况下,我错过了删除每个节点上的/etc/cni/net.d/10-aws.conflist文件。
总之,我们需要遵循以下步骤:

  1. kubectl delete ds aws-node -n kube-system
    1.删除每个节点上的/etc/cni/net.d/10-aws.conflist
    1.重启kube-proxy pod
    1.安装Weave Net资源。例如:kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml
    在AWS EKS集群上安装Weave Net的官方文档

相关问题