plugin/kubernetes: Handle multiple local IPs and bind (#3208)

* use all local IPs

* mult/bind ips

* gofmt + boundIPs fix

* fix no matching endpoint case

* don't duplicate NS records in answer

* fix answer dedup

* fix comment

* add multi local ip test case
This commit is contained in:
Chris O'Haver 2019-09-05 09:07:55 -04:00 committed by GitHub
parent d79562842a
commit 630d3d60b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 91 additions and 51 deletions

View file

@ -43,11 +43,10 @@ type Kubernetes struct {
Fall fall.F
ttl uint32
opts dnsControlOpts
primaryZoneIndex int
interfaceAddrsFunc func() net.IP
autoPathSearch []string // Local search path from /etc/resolv.conf. Needed for autopath.
TransferTo []string
primaryZoneIndex int
localIPs []net.IP
autoPathSearch []string // Local search path from /etc/resolv.conf. Needed for autopath.
TransferTo []string
}
// New returns a initialized Kubernetes. It default interfaceAddrFunc to return 127.0.0.1. All other
@ -56,7 +55,6 @@ func New(zones []string) *Kubernetes {
k := new(Kubernetes)
k.Zones = zones
k.Namespaces = make(map[string]struct{})
k.interfaceAddrsFunc = func() net.IP { return net.ParseIP("127.0.0.1") }
k.podMode = podModeDisabled
k.ttl = defaultTTL