Add CoreDNS endpoint_pod_names option (#5012)

This commit is contained in:
w33dw0r7d 2019-07-31 21:26:15 +03:00 committed by Kubernetes Prow Robot
parent 54b1fe83f3
commit 92bfcf0467
4 changed files with 10 additions and 1 deletions

View file

@ -65,6 +65,8 @@ following default cluster parameters:
on the CoreDNS service. on the CoreDNS service.
* *coredns_k8s_external_zone* - Zone that will be used when CoreDNS k8s_external plugin is enabled * *coredns_k8s_external_zone* - Zone that will be used when CoreDNS k8s_external plugin is enabled
(default is k8s_external.local) (default is k8s_external.local)
* *enable_coredns_k8s_endpoint_pod_names* - If enabled, it configures endpoint_pod_names option for kubernetes plugin.
on the CoreDNS service.
* *cloud_provider* - Enable extra Kubelet option if operating inside GCE or * *cloud_provider* - Enable extra Kubelet option if operating inside GCE or
OpenStack (default is unset) OpenStack (default is unset)
* *kube_hostpath_dynamic_provisioner* - Required for use of PetSets type in * *kube_hostpath_dynamic_provisioner* - Required for use of PetSets type in

View file

@ -138,6 +138,8 @@ nodelocaldns_health_port: 9254
# Enable k8s_external plugin for CoreDNS # Enable k8s_external plugin for CoreDNS
enable_coredns_k8s_external: false enable_coredns_k8s_external: false
coredns_k8s_external_zone: k8s_external.local coredns_k8s_external_zone: k8s_external.local
# Enable endpoint_pod_names option for kubernetes plugin
enable_coredns_k8s_endpoint_pod_names: false
# Can be docker_dns, host_resolvconf or none # Can be docker_dns, host_resolvconf or none
resolvconf_mode: docker_dns resolvconf_mode: docker_dns

View file

@ -14,6 +14,9 @@ data:
ready ready
kubernetes {{ dns_domain }} in-addr.arpa ip6.arpa { kubernetes {{ dns_domain }} in-addr.arpa ip6.arpa {
pods insecure pods insecure
{% if enable_coredns_k8s_endpoint_pod_names %}
endpoint_pod_names
{% endif %}
{% if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 %} {% if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 %}
upstream {{ upstream_dns_servers|join(' ') }} upstream {{ upstream_dns_servers|join(' ') }}
{% else %} {% else %}

View file

@ -92,6 +92,8 @@ dns_servers: "{{kube_dns_servers[dns_mode]}}"
enable_coredns_k8s_external: false enable_coredns_k8s_external: false
coredns_k8s_external_zone: k8s_external.local coredns_k8s_external_zone: k8s_external.local
enable_coredns_k8s_endpoint_pod_names: false
# Kubernetes configuration dirs and system namespace. # Kubernetes configuration dirs and system namespace.
# Those are where all the additional config stuff goes # Those are where all the additional config stuff goes
# the kubernetes normally puts in /srv/kubernetes. # the kubernetes normally puts in /srv/kubernetes.