From a8265295735dfab5bd03417feb1ba73e6ccb42ab Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 1 Jun 2015 12:21:39 -0700 Subject: [PATCH] Insert 'svc' into the DNS search paths Fixes #8569. This requires the DNS server to be running kube2sky v1.6 or higher (part of release 0.18). Users with older kube2sky MUST NOT update to this kubelet until they upgrade DNS. Versions of kube2sky >= 1.6 support both old and new style names. Old style names are deprectaed and will be removed around the time of kubernetes v1.0 release. --- pkg/kubelet/kubelet.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 2b218c190da..95c637b810d 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -1014,8 +1014,9 @@ 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...) + nsSvcDomain := fmt.Sprintf("%s.svc.%s", pod.Namespace, kl.clusterDomain) + svcDomain := fmt.Sprintf("svc.%s", kl.clusterDomain) + dnsSearch = append([]string{nsSvcDomain, svcDomain, kl.clusterDomain}, hostSearch...) } return dns, dnsSearch, nil }