From 54416cabfd2a83517ca8406e9b2e1efb22bc7f86 Mon Sep 17 00:00:00 2001
From: Toni Pokki <tpokki@users.noreply.github.com>
Date: Wed, 5 Jun 2019 09:27:55 +0300
Subject: [PATCH] prefer_udp for upstream dns servers (#4810)

---
 .../ansible/templates/coredns-config.yml.j2               | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2
index 6e9944d37..9a1e628ff 100644
--- a/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2
+++ b/roles/kubernetes-apps/ansible/templates/coredns-config.yml.j2
@@ -23,9 +23,13 @@ data:
         }
         prometheus :9153
 {% if resolvconf_mode == 'host_resolvconf' and upstream_dns_servers is defined and upstream_dns_servers|length > 0 %}
-        forward . {{ upstream_dns_servers|join(' ') }}
+        forward . {{ upstream_dns_servers|join(' ') }} {
+          prefer_udp
+        }
 {% else %}
-        forward . /etc/resolv.conf
+        forward . /etc/resolv.conf {
+          prefer_udp
+        }
 {% endif %}
         cache 30
         loop
-- 
GitLab