簡體   English   中英

Kubernetes V1.11.0 HA群集CoreDNS PODS未出現

[英]Kubernetes V1.11.0 HA cluster CoreDNS PODS not coming up

我正在嘗試在Centos 7服務器中創建Kubernetes V1.11.0 HA集群。 我在主機上禁用了IPV6。

https://kubernetes.io/docs/setup/independent/high-availability/

根據這些步驟,添加了所有三個主服務器,coreDNS POD不會出現,它會將日志記錄在/ var / log / messages文件中的錯誤以下。

kubectl get pods -n kube-system
NAME                                READY     STATUS              RESTARTS   AGE
coredns-78fcdf6894-8t7bt            0/1       ContainerCreating   0          53m
coredns-78fcdf6894-plmll            0/1       ContainerCreating   0          53m

錯誤信息:

Jul 17 10:09:28 master03 kubelet: E0717 10:09:28.531244   10041 remote_runtime.go:92] RunPodSandbox from runtime service failed: rpc error: code = Unknown desc = [failed to set up sandbox container "8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c" network for pod "coredns-78fcdf6894-8t7bt": NetworkPlugin cni failed to set up pod "coredns-78fcdf6894-8t7bt_kube-system" network: open /proc/sys/net/ipv6/conf/eth0/accept_dad: no such file or directory, failed to clean up sandbox container "8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c" network for pod "coredns-78fcdf6894-8t7bt": NetworkPlugin cni failed to teardown pod "coredns-78fcdf6894-8t7bt_kube-system" network: failed to get IP addresses for "eth0": <nil>]
Jul 17 10:09:28 master03 kubelet: E0717 10:09:28.531286   10041 kuberuntime_sandbox.go:56] CreatePodSandbox for pod "coredns-78fcdf6894-8t7bt_kube-system(7caa3f29-89c3-11e8-aa0f-00505693ca30)" failed: rpc error: code = Unknown desc = [failed to set up sandbox container "8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c" network for pod "coredns-78fcdf6894-8t7bt": NetworkPlugin cni failed to set up pod "coredns-78fcdf6894-8t7bt_kube-system" network: open /proc/sys/net/ipv6/conf/eth0/accept_dad: no such file or directory, failed to clean up sandbox container "8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c" network for pod "coredns-78fcdf6894-8t7bt": NetworkPlugin cni failed to teardown pod "coredns-78fcdf6894-8t7bt_kube-system" network: failed to get IP addresses for "eth0": <nil>]
Jul 17 10:09:28 master03 kubelet: E0717 10:09:28.531298   10041 kuberuntime_manager.go:646] createPodSandbox for pod "coredns-78fcdf6894-8t7bt_kube-system(7caa3f29-89c3-11e8-aa0f-00505693ca30)" failed: rpc error: code = Unknown desc = [failed to set up sandbox container "8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c" network for pod "coredns-78fcdf6894-8t7bt": NetworkPlugin cni failed to set up pod "coredns-78fcdf6894-8t7bt_kube-system" network: open /proc/sys/net/ipv6/conf/eth0/accept_dad: no such file or directory, failed to clean up sandbox container "8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c" network for pod "coredns-78fcdf6894-8t7bt": NetworkPlugin cni failed to teardown pod "coredns-78fcdf6894-8t7bt_kube-system" network: failed to get IP addresses for "eth0": <nil>]
Jul 17 10:09:28 master03 kubelet: E0717 10:09:28.531358   10041 pod_workers.go:186] Error syncing pod 7caa3f29-89c3-11e8-aa0f-00505693ca30 ("coredns-78fcdf6894-8t7bt_kube-system(7caa3f29-89c3-11e8-aa0f-00505693ca30)"), skipping: failed to "CreatePodSandbox" for "coredns-78fcdf6894-8t7bt_kube-system(7caa3f29-89c3-11e8-aa0f-00505693ca30)" with CreatePodSandboxError: "CreatePodSandbox for pod \"coredns-78fcdf6894-8t7bt_kube-system(7caa3f29-89c3-11e8-aa0f-00505693ca30)\" failed: rpc error: code = Unknown desc = [failed to set up sandbox container \"8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c\" network for pod \"coredns-78fcdf6894-8t7bt\": NetworkPlugin cni failed to set up pod \"coredns-78fcdf6894-8t7bt_kube-system\" network: open /proc/sys/net/ipv6/conf/eth0/accept_dad: no such file or directory, failed to clean up sandbox container \"8cf72126bd4ea7e33806512997d02b51c3f95331701928c52c19d1ddea9d6f9c\" network for pod \"coredns-78fcdf6894-8t7bt\": NetworkPlugin cni failed to teardown pod \"coredns-78fcdf6894-8t7bt_kube-system\" network: failed to get IP addresses for \"eth0\": <nil>]"
Jul 17 10:09:28 master03 kubelet: W0717 10:09:28.636173   10041 cni.go:243] CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container "88183d8a24dcafca5b04e3a6454e83aca1417a6934f50cd52b3e6fffbae4f272"
Jul 17 10:09:28 master03 kernel: XFS (dm-18): Mounting V4 Filesystem

如何解決此錯誤消息並帶來coreDNS POD?

謝謝

Coreos Github上有一個問題可以准確描述您的情況。 解決該問題的建議是:

squeed :您使用的是舊版本的CNI,該版本在禁用ipv6的系統上不起作用。 請重新啟用ipv6或升級CNI。

關於CNI Github的相關問題,他還提到:

squeed :正如我已經解釋的,此問題已修復6個月。 請升級您的CNI插件。

耶隆內克評論說:

這是您的部署軟件提供商的問題,在您的情況下可能是https://github.com/kubernetes/kubeadm

但是,如果出於某些原因需要關閉ipv6,則可以使用kubeadm使用插件 KubeDNS而不是CoreDNS安裝集群:

kubeadm初始化--pod-network-cidr = 192.168.0.0 / 16 --feature-gates = CoreDNS = false

或者,您可以刪除CoreDNS部署和服務,然后應用KubeDNS yaml,應將其生成或調整為實際的群集配置。

這是deployAddons.sh文件中的函數,用於部署kube-dns插件:

function deploy_dns {
  echo "Deploying DNS on Kubernetes"
  cp "${KUBE_ROOT}/cluster/addons/dns/kube-dns/kube-dns.yaml.sed" kube-dns.yaml
  sed -i -e "s/\\\$DNS_DOMAIN/${DNS_DOMAIN}/g" kube-dns.yaml
  sed -i -e "s/\\\$DNS_SERVER_IP/${DNS_SERVER_IP}/g" kube-dns.yaml

  KUBEDNS=`eval "${KUBECTL} get services --namespace=kube-system | grep kube-dns | cat"`

  if [ ! "$KUBEDNS" ]; then
    # use kubectl to create kube-dns addon
    ${KUBECTL} --namespace=kube-system create -f kube-dns.yaml

    echo "Kube-dns addon is successfully deployed."
  else
    echo "Kube-dns addon is already deployed. Skipping."
  fi

  echo
}

我必須為我的CoreDNS pod啟用IPv6才能運行。

這是我遵循的步驟:

https://www.thegeekdiary.com/how-to-enable-ipv6-on-centos-rhel-7/

編輯/etc/default/grub並將以下行的內核參數ipv6.disable的值從1更改為0:

# grub2-mkconfig -o /boot/grub2/grub.cfg

# shutdown -r now

我在沒有啟用IPv6的情況下解決了問題(在https://www.facebook.com/groups/k8skr的幫助下)

因此,原因是,Ubuntu的默認Kubernetes CNI為0.6.0。 但是問題已通過Kubernetes CNI 0.7.0修復,因此您可以通過從以下站點下載進行更新並將bin文件替換為/opt/cni/bin/

https://github.com/containernetworking/plugins/releases/tag/v0.7.1

至少,它對我有用:)

我通過這些鏈接的參考解決了這個問題

檢查kubernates故障排除指南和您使用過的網絡插件插件

https://kubernetes.io/docs/setup/independent/troubleshooting-kubeadm/#coredns-or-kube-dns-is-stuck-in-the-pending-state

https://kubernetes.io/docs/concepts/cluster-administration/addons/

並安裝以下內容並檢查

kubectl get pods -n kube-system

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM