Commit 442412e3 authored by Nikhil Jindal's avatar Nikhil Jindal

Merge pull request #8089 from thockin/dns

Introduce an 'svc' segment for DNS search
parents 3d318838 41033af2
...@@ -864,8 +864,12 @@ func (kl *Kubelet) getClusterDNS(pod *api.Pod) ([]string, []string, error) { ...@@ -864,8 +864,12 @@ func (kl *Kubelet) getClusterDNS(pod *api.Pod) ([]string, []string, error) {
dns = append([]string{kl.clusterDNS.String()}, hostDNS...) dns = append([]string{kl.clusterDNS.String()}, hostDNS...)
} }
if kl.clusterDomain != "" { if kl.clusterDomain != "" {
nsDomain := fmt.Sprintf("%s.%s", pod.Namespace, kl.clusterDomain) // TODO(vishh): Remove the oldNsDomain entry once the DNS crossover to inject
dnsSearch = append([]string{nsDomain, kl.clusterDomain}, hostSearch...) // "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 return dns, dnsSearch, nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment