gpt4 book ai didi

kubernetes - 超出 K8s coredns 和 flannel 名称服务器限制

转载 作者:行者123 更新时间:2023-12-04 00:59:21 25 4
gpt4 key购买 nike

我一直在尝试在单个节点中设置 k8s,一切都安装得很好。但是当我检查我的 kube-system pod 的状态时,

CNI -> 法兰绒 pod 有 坠毁 , 原因 -> 超出了名称服务器限制,省略了一些名称服务器,应用的名称服务器行是:x.x.x.x x.x.x.x x.x.x.x

CoreDNS Pod 状态为 ContainerCreating .

在“我的办公室”中,当前服务器已配置为具有静态 ip,当我查看 时/etc/resolv.conf

这是输出

# Generated by NetworkManager
search ORGDOMAIN.BIZ
nameserver 192.168.1.12
nameserver 192.168.2.137
nameserver 192.168.2.136
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 192.168.1.10
nameserver 192.168.1.11

我找不到根本原因,我应该看什么?

最佳答案

简而言之,您在 /etc/resolv.conf 中的条目过多.
这是一个 known issue :

Some Linux distributions (e.g. Ubuntu), use a local DNS resolver by default (systemd-resolved). Systemd-resolved moves and replaces /etc/resolv.conf with a stub file that can cause a fatal forwarding loop when resolving names in upstream servers. This can be fixed manually by using kubelet’s --resolv-conf flag to point to the correct resolv.conf (With systemd-resolved, this is /run/systemd/resolve/resolv.conf). kubeadm (>= 1.11) automatically detects systemd-resolved, and adjusts the kubelet flags accordingly.



Linux’s libc is impossibly stuck (see this bug from 2005) with limits of just 3 DNS nameserver records and 6 DNS search records. Kubernetes needs to consume 1 nameserver record and 3 search records. This means that if a local installation already uses 3 nameservers or uses more than 3 searches, some of those settings will be lost. As a partial workaround, the node can run dnsmasq which will provide more nameserver entries, but not more search entries. You can also use kubelet’s --resolv-conf flag.

If you are using Alpine version 3.3 or earlier as your base image, DNS may not work properly owing to a known issue with Alpine. Check here for more information.


您可能可以在 Kubernetes 代码中更改它,但我不确定其功能。因为它被设置为该值。
代码可定位 here
const (
// Limits on various DNS parameters. These are derived from
// restrictions in Linux libc name resolution handling.
// Max number of DNS name servers.
MaxDNSNameservers = 3
// Max number of domains in search path.
MaxDNSSearchPaths = 6
// Max number of characters in search path.
MaxDNSSearchListChars = 256
)

关于kubernetes - 超出 K8s coredns 和 flannel 名称服务器限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59890834/

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