From 328f8dfe128b5bd8fd0e4168401decf35e221a14 Mon Sep 17 00:00:00 2001 From: prameshj Date: Tue, 22 Oct 2019 23:51:04 -0700 Subject: [PATCH] Use DNS_SERVER_IP as --cluster-dns in all cases. NodeLocalDNS addon listens on both DNS_SERVER_IP as well as LOCAL_DNS_IP. So cluster-dns flag can continue to be DNS_SERVER_IP in all cases. Documented the various variables in the yaml. --- cluster/addons/dns/nodelocaldns/README.md | 11 +++++++++++ cluster/gce/util.sh | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cluster/addons/dns/nodelocaldns/README.md b/cluster/addons/dns/nodelocaldns/README.md index dc9c74195a38..b7f41c9fbb08 100644 --- a/cluster/addons/dns/nodelocaldns/README.md +++ b/cluster/addons/dns/nodelocaldns/README.md @@ -14,6 +14,17 @@ The variables will be substituted by the configure scripts when the yaml is copi To create a GCE cluster with nodelocaldns enabled, use the command: `KUBE_ENABLE_NODELOCAL_DNS=true go run hack/e2e.go -v --up` +We have the following variables in the yaml: +`__PILLAR__DNS__SERVER__` - set to kube-dns service IP. +`__PILLAR__LOCAL__DNS__` - set to the link-local IP(169.254.20.10 by default). +`__PILLAR__DNS__DOMAIN__` - set to the cluster domain(cluster.local by default). + +The following variables will be set by the node-cache images - k8s.gcr.io/k8s-dns-node-cache:1.15.6 or later. +The values will be determined by reading the kube-dns configMap for custom +Upstream server configuration. +`__PILLAR__CLUSTER__DNS__` - Upstream server for in-cluster queries. +`__PILLAR__UPSTREAM__SERVERS__` - Upstream servers for external queries. + ### Network policy and DNS connectivity When running nodelocaldns addon on clusters using network policy, additional rules might be required to enable dns connectivity. diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 4e2212d558c9..3be1ad188836 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -950,9 +950,6 @@ function print-common-kubelet-config { declare quoted_dns_server_ip declare quoted_dns_domain quoted_dns_server_ip=$(yaml-quote "${DNS_SERVER_IP}") - if [[ "${ENABLE_NODELOCAL_DNS:-}" == "true" ]]; then - quoted_dns_server_ip=$(yaml-quote "${LOCAL_DNS_IP}") - fi quoted_dns_domain=$(yaml-quote "${DNS_DOMAIN}") cat <