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.
This commit is contained in:
Tim Hockin 2015-06-01 12:21:39 -07:00
parent 5520386b18
commit a826529573

View File

@ -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
}