From c1c98924c3733b853115c62adc1a2b5978ae2df3 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Fri, 14 Dec 2018 09:41:51 +0000 Subject: Add new plugin: external - resolve k8s ingress and LB address with external names (#2379) * Add new plugin: external This plugin works in conjunction with the kubernetes plugin and exports ingress and LB addresses as DNS records. It bypasses backend.go and backend_lookup.go flow because it is not needed. README, tests are implemented. The tests only exercise the unit tests, this has not been tested in any ci. Signed-off-by: Miek Gieben * Rename to k8s_external Signed-off-by: Miek Gieben * go gen Signed-off-by: Miek Gieben --- plugin/kubernetes/controller.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugin/kubernetes/controller.go') diff --git a/plugin/kubernetes/controller.go b/plugin/kubernetes/controller.go index df90fcf82..9a2e9994a 100644 --- a/plugin/kubernetes/controller.go +++ b/plugin/kubernetes/controller.go @@ -172,7 +172,11 @@ func svcIPIndexFunc(obj interface{}) ([]string, error) { if !ok { return nil, errObj } - return []string{svc.ClusterIP}, nil + if len(svc.ExternalIPs) == 0 { + return []string{svc.ClusterIP}, nil + } + + return append([]string{svc.ClusterIP}, svc.ExternalIPs...), nil } func svcNameNamespaceIndexFunc(obj interface{}) ([]string, error) { -- cgit v1.2.3