gpt4 book ai didi

kubernetes - 使用网络插件 "cni": cni config unintialized; Skipping pod

转载 作者:行者123 更新时间:2023-12-04 18:32:15 28 4
gpt4 key购买 nike

我创建了 使用 进行集群kubeadm init .

我在 /var/log/messages 中收到错误消息.

Oct 20 10:09:52 aws08 kubelet: I1020 10:09:52.015921    7116
docker_manager.go:1787] DNS ResolvConfPath exists:
/var/lib/docker/containers/717adf7a8481637ac20a9ba103d8f97635a88bf05f18bd4299f0d164e48f2920/resolv.conf.
Will attempt to add ndots option: options ndots:5 Oct 20 10:09:52
aws08 kubelet: I1020 10:09:52.015963 7116 docker_manager.go:2121]
Calling network plugin cni to setup pod for
kube-dns-2247936740-cjij4_kube-system(3b296413-96aa-11e6-8c40-02fff663a168)
Oct 20 10:09:52 aws08 kubelet: E1020 10:09:52.015982 7116
docker_manager.go:2127] Failed to setup network for pod
"kube-dns-2247936740-cjij4_kube-system(3b296413-96aa-11e6-8c40-02fff663a168)"
using network plugins "cni": cni config unintialized; Skipping pod Oct
20 10:09:52 aws08 kubelet: I1020 10:09:52.018824 7116
docker_manager.go:1492] Killing container
"717adf7a8481637ac20a9ba103d8f97635a88bf05f18bd4299f0d164e48f2920
kube-system/kube-dns-2247936740-cjij4" with 30 second grace period

DNS pod 失败:
kube-system   kube-dns-2247936740-j5rtc        0/3       ContainerCreating   21         1h

如果我禁用 CNI ,DNS pod 正在运行。但是 DNS 的问题仍然存在。

禁用cni的方法是评论 KUBELET_NETWORK_ARGS线在 /etc/systemd/system/kubelet.service.d/10-kubeadm.conf并重新启动 kubelet服务
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf --require-kubeconfig=true"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
# Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
Environment="KUBELET_DNS_ARGS=--cluster-dns=100.64.0.10 --cluster-domain=cluster.local"
Environment="KUBELET_EXTRA_ARGS=--v=4"
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_EXTRA_ARGS

其次是:

须藤 systemctl 重启 kubelet

最佳答案

我猜你忘了 setup the pod network .

从文档:

It is necessary to do this before you try to deploy any applications to your cluster, and before kube-dns will start up. Note also that kubeadm only supports CNI based networks and therefore kubenet based networks will not work.



您可以使用以下命令安装 pod 网络附加组件:
kubectl apply -f <add-on.yaml>

例子:
kubectl create -f https://git.io/weave-kube

安装 Weave Net添加在。

完成此操作后,您可能需要重新创建 kube-dns pod。

关于kubernetes - 使用网络插件 "cni": cni config unintialized; Skipping pod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40151714/

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