diff options
author | 2019-09-05 09:07:55 -0400 | |
---|---|---|
committer | 2019-09-05 09:07:55 -0400 | |
commit | 630d3d60b9fa3b9c1f070e4aa0504e50a85d70c2 (patch) | |
tree | b9b95d55ecca3964142f6d064b48065f1cb5128b /plugin/kubernetes/setup.go | |
parent | d79562842aacfa5808ec0b8d160d720470ece060 (diff) | |
download | coredns-630d3d60b9fa3b9c1f070e4aa0504e50a85d70c2.tar.gz coredns-630d3d60b9fa3b9c1f070e4aa0504e50a85d70c2.tar.zst coredns-630d3d60b9fa3b9c1f070e4aa0504e50a85d70c2.zip |
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
Diffstat (limited to 'plugin/kubernetes/setup.go')
-rw-r--r-- | plugin/kubernetes/setup.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go index eb33936fa..1309139d7 100644 --- a/plugin/kubernetes/setup.go +++ b/plugin/kubernetes/setup.go @@ -61,6 +61,12 @@ func setup(c *caddy.Controller) error { return k }) + // get locally bound addresses + c.OnStartup(func() error { + k.localIPs = boundIPs(c) + return nil + }) + return nil } @@ -113,7 +119,6 @@ func kubernetesParse(c *caddy.Controller) (*Kubernetes, error) { func ParseStanza(c *caddy.Controller) (*Kubernetes, error) { k8s := New([]string{""}) - k8s.interfaceAddrsFunc = localPodIP k8s.autoPathSearch = searchFromResolvConf() opts := dnsControlOpts{ |