From 41033af25621b00e7ed6323a1128bc16494df5f4 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 11 May 2015 17:12:59 -0700 Subject: [PATCH] Introduce an 'svc' segment for DNS search --- pkg/kubelet/kubelet.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index cc2f2fc064adb..0cbdb8e5207a3 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -864,8 +864,12 @@ func (kl *Kubelet) getClusterDNS(pod *api.Pod) ([]string, []string, error) { dns = append([]string{kl.clusterDNS.String()}, hostDNS...) } if kl.clusterDomain != "" { - nsDomain := fmt.Sprintf("%s.%s", pod.Namespace, kl.clusterDomain) - dnsSearch = append([]string{nsDomain, kl.clusterDomain}, hostSearch...) + // TODO(vishh): Remove the oldNsDomain entry once the DNS crossover to inject + // "svc" is done. + oldNsDomain := fmt.Sprintf("%s.%s", pod.Namespace, kl.clusterDomain) + nsSvcDomain := fmt.Sprintf("%s.svc.%s", pod.Namespace, kl.clusterDomain) + svcDomain := fmt.Sprintf("svc.%s", kl.clusterDomain) + dnsSearch = append([]string{oldNsDomain, nsSvcDomain, svcDomain, kl.clusterDomain}, hostSearch...) } return dns, dnsSearch, nil }