Kubernetes 超过K8s coredns和flannel名称服务器限制
我一直在尝试在一个节点上安装k8s,一切都安装得很好。但当我检查kube系统吊舱的状态时 CNI->flannelpod已崩溃,原因->超过了名称服务器限制,省略了一些名称服务器,应用的名称服务器行为:x.x.x.x.x.x x.x.x.x CoreDNSpods状态为集装箱创建 在我的办公室中,当前服务器已配置为具有静态ip,当我选中/etc/resolv.conf 这是输出Kubernetes 超过K8s coredns和flannel名称服务器限制,kubernetes,flannel,coredns,Kubernetes,Flannel,Coredns,我一直在尝试在一个节点上安装k8s,一切都安装得很好。但当我检查kube系统吊舱的状态时 CNI->flannelpod已崩溃,原因->超过了名称服务器限制,省略了一些名称服务器,应用的名称服务器行为:x.x.x.x.x.x x.x.x.x CoreDNSpods状态为集装箱创建 在我的办公室中,当前服务器已配置为具有静态ip,当我选中/etc/resolv.conf 这是输出 # Generated by NetworkManager search ORGDOMAIN.BIZ nameserv
# 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
中有太多条目
这是一个:
某些Linux发行版(如Ubuntu)默认使用本地DNS解析程序(systemd resolved)。Systemd resolved移动并用存根文件替换/etc/resolv.conf
,在解析上游服务器中的名称时,存根文件可能导致致命的转发循环。通过使用kubelet的--resolv conf
标志指向正确的resolv.conf
(使用systemd resolved
,这是/run/systemd/resolv.conf
)kubeadm(>=1.11)自动检测systemd resolved
,并相应调整kubelet标志。
也
Linux的libc不可能被卡住(),只有3个DNSnameserver
记录和6个DNSsearch
记录。Kubernetes需要消耗1个名称服务器
记录和3个搜索
记录。这意味着,如果本地安装已经使用了3个nameserver
s或使用了3个以上的search
es,则其中一些设置将丢失。作为部分解决方法,节点可以运行dnsmasq
,这将提供更多nameserver
条目,但不会提供更多search
条目。您还可以使用kubelet的--resolv conf
标志
如果您使用的是Alpine 3.3版或更早版本作为基础映像,则DNS可能由于Alpine存在已知问题而无法正常工作。查看更多信息
您可能可以在Kubernetes代码中更改这一点,但我不确定其功能。因为它设置为该值是为了达到目的
可以找到代码
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
)