Skip to content

Commit

Permalink
Merge pull request kubernetes#8089 from thockin/dns
Browse files Browse the repository at this point in the history
Introduce an 'svc' segment for DNS search
  • Loading branch information
nikhiljindal committed May 12, 2015
2 parents 3d31883 + 41033af commit 442412e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 442412e

Please sign in to comment.