Description
What would you like to be added?
A kubelet flag that will disable or otherwise prevent these warning messages from being printed.
Why is this needed?
The condition that causes the DNSConfigForming "Nameserver limits were exceeded, some nameservers have been omitted, the applied nameserver line is" warning log messages and k8s events is well known:
- Nameserver limits were exceeded, some nameservers have been omitted, the applied nameserver #82756
- Hetzner DNS Issue (resolv-conf) kubermatic/kubeone#1744
- http://jpetazzo.github.io/2024/05/12/understanding-kubernetes-dns-hostnetwork-dnspolicy-dnsconfigforming/
- https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#known-issues
However, in some network/cloud environments, having > 3 DNS servers is effectively considered correct or unavoidable and it is not always possible to limit. For example, AFAIK NetworkManager does not have an option to limit the number of DNS servers received via DHCP. So this is generally considered to be a problem with no solution that you just have to live with.
However the issue with that is the constant noise and log pollution generated by these messages, from kubelet and any pods that use hostNetwork. It fills up syslog/journald on the nodes and contributes to unnecessary load (IOPS and storage) when the events are written in etcd, especially for large clusters, all of which is really unnecessary because the issue is considered harmless and can be safely ignored - so let's actually ignore it! The noise produced by these warnings is worse than the actual condition that they are warning about. So can we fully suppress these events and messages? There could be a kubelet option like --ignore-dns-nameserver-limit-warning=True
to hide the warnings or --force-truncate-nameservers=3
to explicitly drop any nameservers after the first 3 so that we don't need to complain about them.