mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
dont duplicate service recrod for every port (#3240)
This commit is contained in:
committed by
Miek Gieben
parent
acabfc5e9e
commit
70f2bd1dff
@@ -110,15 +110,16 @@ func (k *Kubernetes) transfer(c chan dns.RR, zone string) {
|
|||||||
case api.ServiceTypeClusterIP, api.ServiceTypeNodePort, api.ServiceTypeLoadBalancer:
|
case api.ServiceTypeClusterIP, api.ServiceTypeNodePort, api.ServiceTypeLoadBalancer:
|
||||||
clusterIP := net.ParseIP(svc.ClusterIP)
|
clusterIP := net.ParseIP(svc.ClusterIP)
|
||||||
if clusterIP != nil {
|
if clusterIP != nil {
|
||||||
|
s := msg.Service{Host: svc.ClusterIP, TTL: k.ttl}
|
||||||
|
s.Key = strings.Join(svcBase, "/")
|
||||||
|
|
||||||
|
// Change host from IP to Name for SRV records
|
||||||
|
host := emitAddressRecord(c, s)
|
||||||
|
|
||||||
for _, p := range svc.Ports {
|
for _, p := range svc.Ports {
|
||||||
|
s := msg.Service{Host: host, Port: int(p.Port), TTL: k.ttl}
|
||||||
s := msg.Service{Host: svc.ClusterIP, Port: int(p.Port), TTL: k.ttl}
|
|
||||||
s.Key = strings.Join(svcBase, "/")
|
s.Key = strings.Join(svcBase, "/")
|
||||||
|
|
||||||
// Change host from IP to Name for SRV records
|
|
||||||
host := emitAddressRecord(c, s)
|
|
||||||
s.Host = host
|
|
||||||
|
|
||||||
// Need to generate this to handle use cases for peer-finder
|
// Need to generate this to handle use cases for peer-finder
|
||||||
// ref: https://github.com/coredns/coredns/pull/823
|
// ref: https://github.com/coredns/coredns/pull/823
|
||||||
c <- s.NewSRV(msg.Domain(s.Key), 100)
|
c <- s.NewSRV(msg.Domain(s.Key), 100)
|
||||||
|
|||||||
Reference in New Issue
Block a user