Browse Source

force other resolvers to be secondary when using systemd-resolved (#5391)

Change-Id: I33d46c7e0c5374467e22c5a652b282d1703dea85
pull/5403/head
Matthew Mosesohn 5 years ago
committed by Kubernetes Prow Robot
parent
commit
f599a4a859
2 changed files with 5 additions and 9 deletions
  1. 6
      roles/kubernetes/preinstall/tasks/0040-set_facts.yml
  2. 8
      roles/kubernetes/preinstall/templates/resolved.conf.j2

6
roles/kubernetes/preinstall/tasks/0040-set_facts.yml

@ -137,11 +137,11 @@
set_fact: set_fact:
coredns_server: |- coredns_server: |-
{%- if dns_mode == 'coredns' and not dns_early|bool -%} {%- if dns_mode == 'coredns' and not dns_early|bool -%}
{{ [ skydns_server ] + upstream_dns_servers|default([]) }}
{{ [ skydns_server ] }}
{%- elif dns_mode == 'coredns_dual' and not dns_early|bool -%} {%- elif dns_mode == 'coredns_dual' and not dns_early|bool -%}
{{ [ skydns_server ] + [ skydns_server_secondary ] + upstream_dns_servers|default([]) }}
{{ [ skydns_server ] + [ skydns_server_secondary ] }}
{%- elif dns_mode == 'manual' and not dns_early|bool -%} {%- elif dns_mode == 'manual' and not dns_early|bool -%}
{{ ( manual_dns_server.split(',') | list) + upstream_dns_servers|default([]) }}
{{ ( manual_dns_server.split(',') | list) }}
{%- elif dns_early|bool -%} {%- elif dns_early|bool -%}
{{ upstream_dns_servers|default([]) }} {{ upstream_dns_servers|default([]) }}
{%- endif -%} {%- endif -%}

8
roles/kubernetes/preinstall/templates/resolved.conf.j2

@ -1,10 +1,6 @@
[Resolve] [Resolve]
{% if dns_late %}
DNS={{ ( coredns_server + nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
{% else %}
DNS={{ ( nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
{% endif %}
#FallbackDNS=
DNS={{ coredns_server | list | join(' ') }}
FallbackDNS={{ ( nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
Domains={{ ([ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([])) | join(' ') }} Domains={{ ([ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([])) | join(' ') }}
#LLMNR=no #LLMNR=no
#MulticastDNS=no #MulticastDNS=no

Loading…
Cancel
Save