Skip to content

Commit

Permalink
[systemd-resolved] Fix DNS configuration according to docs/dns-stack.…
Browse files Browse the repository at this point in the history
…md and during reset of cluster (kubernetes-sigs#8560) (kubernetes-sigs#8561)
  • Loading branch information
onock authored and sakuraiyuta committed Apr 16, 2022
1 parent c2eb6cd commit 045a5e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions reset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@
environment: "{{ proxy_disable_env }}"
roles:
- { role: kubespray-defaults}
- { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_early: true }
- { role: reset, tags: reset }
6 changes: 5 additions & 1 deletion roles/kubernetes/preinstall/templates/resolved.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[Resolve]
{% if dns_early is sameas true and dns_late is sameas false %}
#DNS=
{% else %}
DNS={{ ([nodelocaldns_ip] if enable_nodelocaldns else coredns_server )| list | join(' ') }}
FallbackDNS={{ ( nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
{% endif %}
FallbackDNS={{ ( upstream_dns_servers|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
Domains={{ ([ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([])) | join(' ') }}
#LLMNR=no
#MulticastDNS=no
Expand Down

0 comments on commit 045a5e6

Please sign in to comment.