【问题标题】:Readiness probe failed error in weave kubernetes编织 kubernetes 中的就绪探测失败错误
【发布时间】:2019-02-06 09:28:46
【问题描述】:

我有一个集群,我在 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 仪表板上显示以下错误:

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')"

谁能指导我如何解决这个问题。

【问题讨论】:

  • 您是否尝试通过运行sysctl -w net.bridge.bridge-nf-call-iptables=1 将桥接的 IPv4 流量传递给 iptables?

标签: kubernetes weave


【解决方案1】:

对我有用的是将iptable 规则添加到我的kube-dns 服务的IP 范围内。

# 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找到。

【讨论】:

    猜你喜欢
    • 2018-07-10
    • 1970-01-01
    • 2019-12-05
    • 2021-02-06
    • 2023-03-11
    • 1970-01-01
    • 2021-01-01
    • 2020-11-25
    • 2022-09-26
    相关资源
    最近更新 更多