aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/setup.go
diff options
context:
space:
mode:
authorGravatar Brian Akins <brian@akins.org> 2017-11-08 08:07:10 -0500
committerGravatar John Belamaric <jbelamaric@infoblox.com> 2017-11-08 08:07:10 -0500
commit3527be6c0056acbcd8dc9848ff96be2136c68ed5 (patch)
treecb03011fb882955cf67c726d6c3cc78f84451968 /plugin/kubernetes/setup.go
parentc6ce769fc64f00d1fd0d34914a9bb5f4de2f7c2c (diff)
downloadcoredns-3527be6c0056acbcd8dc9848ff96be2136c68ed5.tar.gz
coredns-3527be6c0056acbcd8dc9848ff96be2136c68ed5.tar.zst
coredns-3527be6c0056acbcd8dc9848ff96be2136c68ed5.zip
Add option to use pod name rather than IP address for Kubernetes (#1190)
Change to use a new 'endpoints' directive and use a constant Add initial docs for 'endpoints' directive Add tests to Kubernetes setup for endpoints Changes based on PR feedback endpoint_pod_names is a boolean config option. Chahanged docs to reflect this. Add a test when endpoints_pod_names is not set Update README.md Remove endpointNameModeName as it is no longer used
Diffstat (limited to 'plugin/kubernetes/setup.go')
-rw-r--r--plugin/kubernetes/setup.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go
index 13e6c810f..fd63d6ff6 100644
--- a/plugin/kubernetes/setup.go
+++ b/plugin/kubernetes/setup.go
@@ -104,6 +104,13 @@ func kubernetesParse(c *caddy.Controller) (*Kubernetes, dnsControlOpts, error) {
for c.NextBlock() {
switch c.Val() {
+ case "endpoint_pod_names":
+ args := c.RemainingArgs()
+ if len(args) > 0 {
+ return nil, opts, c.ArgErr()
+ }
+ k8s.endpointNameMode = true
+ continue
case "pods":
args := c.RemainingArgs()
if len(args) == 1 {