Add optional manual dns_mode (#2178)
parent
eb80f9b606
commit
bf1411060e
|
@ -50,7 +50,7 @@ DNS modes supported by Kubespray
|
||||||
You can modify how Kubespray sets up DNS for your cluster with the variables ``dns_mode`` and ``resolvconf_mode``.
|
You can modify how Kubespray sets up DNS for your cluster with the variables ``dns_mode`` and ``resolvconf_mode``.
|
||||||
|
|
||||||
## dns_mode
|
## dns_mode
|
||||||
``dns_mode`` configures how Kubespray will setup cluster DNS. There are three modes available:
|
``dns_mode`` configures how Kubespray will setup cluster DNS. There are four modes available:
|
||||||
|
|
||||||
#### dnsmasq_kubedns (default)
|
#### dnsmasq_kubedns (default)
|
||||||
This installs an additional dnsmasq DaemonSet which gives more flexibility and lifts some
|
This installs an additional dnsmasq DaemonSet which gives more flexibility and lifts some
|
||||||
|
@ -62,6 +62,12 @@ other queries are forwardet to the nameservers found in ``upstream_dns_servers``
|
||||||
This does not install the dnsmasq DaemonSet and instructs kubelet to directly use kubedns/skydns for
|
This does not install the dnsmasq DaemonSet and instructs kubelet to directly use kubedns/skydns for
|
||||||
all queries.
|
all queries.
|
||||||
|
|
||||||
|
#### manual
|
||||||
|
This does not install dnsmasq or kubedns, but allows you to specify
|
||||||
|
`manual_dns_server`, which will be configured on nodes for handling Pod DNS.
|
||||||
|
Use this method if you plan to install your own DNS server in the cluster after
|
||||||
|
initial deployment.
|
||||||
|
|
||||||
#### none
|
#### none
|
||||||
This does not install any of dnsmasq and kubedns/skydns. This basically disables cluster DNS completely and
|
This does not install any of dnsmasq and kubedns/skydns. This basically disables cluster DNS completely and
|
||||||
leaves you with a non functional cluster.
|
leaves you with a non functional cluster.
|
||||||
|
|
|
@ -112,8 +112,11 @@ kube_apiserver_insecure_port: 8080 # (http)
|
||||||
cluster_name: cluster.local
|
cluster_name: cluster.local
|
||||||
# Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
|
# Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
|
||||||
ndots: 2
|
ndots: 2
|
||||||
# Can be dnsmasq_kubedns, kubedns or none
|
# Can be dnsmasq_kubedns, kubedns, manual or none
|
||||||
dns_mode: kubedns
|
dns_mode: kubedns
|
||||||
|
# Set manual server if using a custom cluster DNS server
|
||||||
|
#manual_dns_server: 10.x.x.x
|
||||||
|
|
||||||
# Can be docker_dns, host_resolvconf or none
|
# Can be docker_dns, host_resolvconf or none
|
||||||
resolvconf_mode: docker_dns
|
resolvconf_mode: docker_dns
|
||||||
# Deploy netchecker app to verify DNS resolve as an HTTP service
|
# Deploy netchecker app to verify DNS resolve as an HTTP service
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
{{ [ skydns_server ] }}
|
{{ [ skydns_server ] }}
|
||||||
{%- elif dns_mode == 'dnsmasq_kubedns' -%}
|
{%- elif dns_mode == 'dnsmasq_kubedns' -%}
|
||||||
{{ [ dnsmasq_dns_server ] }}
|
{{ [ dnsmasq_dns_server ] }}
|
||||||
|
{%- elif dns_mode == 'manual' -%}
|
||||||
|
{{ [ manual_dns_server ] }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
- name: set base docker dns facts
|
- name: set base docker dns facts
|
||||||
|
|
|
@ -50,6 +50,8 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
|
||||||
{% set kubelet_args_cluster_dns %}--cluster-dns={{ skydns_server }}{% endset %}
|
{% set kubelet_args_cluster_dns %}--cluster-dns={{ skydns_server }}{% endset %}
|
||||||
{% elif dns_mode == 'dnsmasq_kubedns' %}
|
{% elif dns_mode == 'dnsmasq_kubedns' %}
|
||||||
{% set kubelet_args_cluster_dns %}--cluster-dns={{ dnsmasq_dns_server }}{% endset %}
|
{% set kubelet_args_cluster_dns %}--cluster-dns={{ dnsmasq_dns_server }}{% endset %}
|
||||||
|
{% elif dns_mode == 'manual' %}
|
||||||
|
{% set kubelet_args_cluster_dns %}--cluster-dns={{ manual_dns_server }}{% endset %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set kubelet_args_cluster_dns %}{% endset %}
|
{% set kubelet_args_cluster_dns %}{% endset %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -39,6 +39,8 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
|
||||||
{% set kubelet_args_cluster_dns %}--cluster-dns={{ skydns_server }}{% endset %}
|
{% set kubelet_args_cluster_dns %}--cluster-dns={{ skydns_server }}{% endset %}
|
||||||
{% elif dns_mode == 'dnsmasq_kubedns' %}
|
{% elif dns_mode == 'dnsmasq_kubedns' %}
|
||||||
{% set kubelet_args_cluster_dns %}--cluster-dns={{ dnsmasq_dns_server }}{% endset %}
|
{% set kubelet_args_cluster_dns %}--cluster-dns={{ dnsmasq_dns_server }}{% endset %}
|
||||||
|
{% elif dns_mode == 'manual' %}
|
||||||
|
{% set kubelet_args_cluster_dns %}--cluster-dns={{ manual_dns_server }}{% endset %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set kubelet_args_cluster_dns %}{% endset %}
|
{% set kubelet_args_cluster_dns %}{% endset %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -95,6 +95,8 @@
|
||||||
dnsmasq_server: |-
|
dnsmasq_server: |-
|
||||||
{%- if dns_mode == 'kubedns' and not dns_early|bool -%}
|
{%- if dns_mode == 'kubedns' and not dns_early|bool -%}
|
||||||
{{ [ skydns_server ] + upstream_dns_servers|default([]) }}
|
{{ [ skydns_server ] + upstream_dns_servers|default([]) }}
|
||||||
|
{%- elif dns_mode == 'manual' and not dns_early|bool -%}
|
||||||
|
{{ [ manual_dns_server ] + upstream_dns_servers|default([]) }}
|
||||||
{%- elif dns_early|bool -%}
|
{%- elif dns_early|bool -%}
|
||||||
{{ upstream_dns_servers|default([]) }}
|
{{ upstream_dns_servers|default([]) }}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
|
|
|
@ -33,8 +33,12 @@ retry_stagger: 5
|
||||||
cluster_name: cluster.local
|
cluster_name: cluster.local
|
||||||
# Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
|
# Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
|
||||||
ndots: 2
|
ndots: 2
|
||||||
# Can be dnsmasq_kubedns, kubedns or none
|
# Can be dnsmasq_kubedns, kubedns, manual or none
|
||||||
dns_mode: kubedns
|
dns_mode: kubedns
|
||||||
|
|
||||||
|
# Should be set to a cluster IP if using a custom cluster DNS
|
||||||
|
# manual_dns_server: 10.x.x.x
|
||||||
|
|
||||||
# Can be docker_dns, host_resolvconf or none
|
# Can be docker_dns, host_resolvconf or none
|
||||||
resolvconf_mode: docker_dns
|
resolvconf_mode: docker_dns
|
||||||
# Deploy netchecker app to verify DNS resolve as an HTTP service
|
# Deploy netchecker app to verify DNS resolve as an HTTP service
|
||||||
|
|
Loading…
Reference in New Issue