From 31a7b7d24ec9de95e321a8b90c90c0360aa85fdb Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Fri, 12 May 2017 15:57:24 -0400 Subject: [PATCH] default to kubedns and set nxdomain in kubedns deployment if that's the dns_mode --- inventory/group_vars/k8s-cluster.yml | 2 +- roles/kubernetes-apps/ansible/templates/kubedns-deploy.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/inventory/group_vars/k8s-cluster.yml b/inventory/group_vars/k8s-cluster.yml index d304b79a9..606d271d4 100644 --- a/inventory/group_vars/k8s-cluster.yml +++ b/inventory/group_vars/k8s-cluster.yml @@ -98,7 +98,7 @@ cluster_name: cluster.local # Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods ndots: 2 # Can be dnsmasq_kubedns, kubedns or none -dns_mode: dnsmasq_kubedns +dns_mode: kubedns # Can be docker_dns, host_resolvconf or none resolvconf_mode: docker_dns # Deploy netchecker app to verify DNS resolve as an HTTP service diff --git a/roles/kubernetes-apps/ansible/templates/kubedns-deploy.yml b/roles/kubernetes-apps/ansible/templates/kubedns-deploy.yml index 1bae177d3..afb5b61ad 100644 --- a/roles/kubernetes-apps/ansible/templates/kubedns-deploy.yml +++ b/roles/kubernetes-apps/ansible/templates/kubedns-deploy.yml @@ -82,6 +82,9 @@ spec: - --server=127.0.0.1#10053 {% if kube_log_level == '4' %} - --log-queries +{% endif %} +{% if dns_mode == 'kubedns' %} + - --local=/{{ bogus_domains }} {% endif %} ports: - containerPort: 53