From 3bb4e659b2d0a9020c76968c82b4b8d776a6059f Mon Sep 17 00:00:00 2001 From: Ricardo Katz Date: Tue, 13 Mar 2018 11:35:29 -0300 Subject: [PATCH] Document the service with ClusterIP wildcard (#1605) This PR documents the trick exposed in coredns/coredns#1357 about using wildcards to get all POD IPs from a service with ClusterIP (as used in 'endpoints') --- plugin/kubernetes/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/kubernetes/README.md b/plugin/kubernetes/README.md index 136b301f5..46e32cf2b 100644 --- a/plugin/kubernetes/README.md +++ b/plugin/kubernetes/README.md @@ -198,3 +198,10 @@ or the word "any"), then that label will match all values. The labels that acce * _port and/or protocol_ in an `SRV` request: __port_.__protocol_.service.namespace.svc.zone., e.g. `_http.*.service.ns.svc.` * multiple wild cards are allowed in a single query, e.g. `A` Request `*.*.svc.zone.` or `SRV` request `*.*.*.*.svc.zone.` + + * Wildcard can be used also to resolve PODs IPs as `A` records in a Service with ClusterIP. e.g.: `*.service.ns.svc.myzone.local` will return the PODs IPs as the following: + ``` +*.service.default.svc.cluster.local. 5 IN A 192.168.10.10 +*.service.default.svc.cluster.local. 5 IN A 192.168.25.15 +``` + This response can be randomized using the `loadbalance` plugin