Repository navigation
feat: upstream traffic distribution and cluster DNS forward options - #5
Merged
Merged
Conversation
Two values for a node-local-dns whose upstream can go away with a node (MOB-768): - config.upstreamServiceTrafficDistribution sets trafficDistribution on the upstream service, e.g. PreferSameNode to ask the cluster DNS pod on the same node first. - config.clusterDnsForwardConfig adds forward options to the cluster domain and the reverse zones, like upstreamForwardConfig does for the default block, e.g. failfast_all_unhealthy_upstreams. upstreamForwardConfig now defaults to [] (the template ranges over a list; the map default made helm warn when a list was set). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For MOB-768. Needed by holoplot/sw__holokube#99, which gives node-local-dns one CoreDNS per controller as its upstream.
Change (chart 0.3.0)
config.upstreamServiceTrafficDistribution: setstrafficDistributionon the upstream service. WithPreferSameNode, node-local-dns asks the cluster DNS pod on its own node first, and pods on other nodes only when its own node has none ready.PreferSameNodeneeds Kubernetes 1.35, or 1.34 with thePreferSameTrafficDistributionfeature gate.config.clusterDnsForwardConfig: extraforwardoptions for the cluster domain and the reverse zones (in-addr.arpa,ip6.arpa), likeupstreamForwardConfigalready does for the default block. For examplefailfast_all_unhealthy_upstreamsmakes node-local-dns answer SERVFAIL at once when no upstream is healthy, instead of waiting for one.upstreamForwardConfignow defaults to[]. The template iterates over it as a list, and the old{}default made helm warn whenever a list was set.The default render is unchanged.
Why
On an HA controller ring, a controller holding both k3s CoreDNS replicas lost power, and the cluster had no CoreDNS for 4 min. node-local-dns kept answering the cached names, thanks to
serve_stale. But a name looked up without a trailing dot is first tried with the search domains. Those queries weren't in the cache, and node-local-dns waited on the dead upstream for each of them, so lookups timed out before reaching the cached name. Details in MOB-768.Tested
helm unittest: 9 passed. The newtests/upstream_test.yamlcovers both values and their defaults.helm lint: clean.failfast_all_unhealthy_upstreamswith node-cache 1.26.7, against an upstream that drops packets:trafficDistribution: PreferSameNodeis accepted by the API server on k3s v1.35.7 (server-side dry run). ThePreferSameTrafficDistributionfeature is enabled there.🤖 Generated with Claude Code