Allow the DNS stack to be backward compatible with an old dns_domain (#10630)

Handle all old dns domains:
- for nodelocaldns: in the same server block as the current dns_domain
- for coredns: uffix rewrite of each of the old dns domains to the
  current one
This commit is contained in:
Max Gautier
2024-01-24 06:31:22 +01:00
committed by GitHub
parent 0e26f6f3e2
commit c80f2cd573
4 changed files with 24 additions and 1 deletions

View File

@@ -37,6 +37,10 @@ coredns_pod_disruption_budget_max_unavailable: "30%"
# coredns_additional_error_config: |
# consolidate 5m ".* i/o timeout$" warning
# Configure coredns and nodelocaldns to correctly answer DNS queries when you changed
# your 'dns_domain' and some workloads used it directly.
old_dns_domains: []
# dns_upstream_forward_extra_opts apply to coredns forward section as well as nodelocaldns upstream target forward section
# dns_upstream_forward_extra_opts:
# policy: sequential

View File

@@ -49,6 +49,9 @@ data:
{% if coredns_rewrite_block is defined %}
{{ coredns_rewrite_block | indent(width=8, first=False) }}
{% endif %}
{% for old_dns_domain in old_dns_domains %}
rewrite name suffix {{ old_dns_domain }} {{ dns_domain }} answer auto
{% endfor %}
ready
kubernetes {{ dns_domain }} {% if coredns_kubernetes_extra_domains is defined %}{{ coredns_kubernetes_extra_domains }} {% endif %}{% if enable_coredns_reverse_dns_lookups %}in-addr.arpa ip6.arpa {% endif %}{
pods insecure

View File

@@ -32,7 +32,7 @@ data:
}
{% endfor %}
{% endif %}
{{ dns_domain }}:53 {
{{ ([dns_domain] + old_dns_domains) | join(' ') }}:53 {
errors
cache {
success 9984 30