* mw/kubernetes: remove federation and cidr
Remove both as we have a corefile syntax change that handles cidr and
remove federation because that is going to be its own middleware.
* backwards incompat changes
This PR:
* removes cidr from kubernetes (core Corefile feature now)
* removes federation from kubernets (comes back as new middleware)
* [remove autopath - which was already gone, so that already was
backwards incompat]
* adds `fallthrough` to the *etcd* middleware and makes you enable it.
* Fail on unknown properties
* documentation
* Disable TestHealthCheck as it uses realtime and fails
* mw/k8s: cleanups
Remove some constants that aren't used any more. Make PrimaryZone
private because it doesn't need to be exported. Remove test that
did not cover corner case as expressed in setup.go
* cleanup this as well
* Support multiple k8s api servers specification and load balance among api servers
This fix adds supports for multiple k8s api servers specification,
load balance among api servers.
When two or more api servers are specified in kubernetes block (endpoint ...),
a proxy is created locally (with randomly generately port). The coredns
will points to the generated proxy so that load balancing could be achieved.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Setup initial healthcheck at the beginning
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update README.md for kubernetes middleware and remove whitespaces.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Use middleware/pkg/healthcheck in middleware/kubernetes
for api proxy
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* mw/k8s: remove dependence on global var
Remove the global coreDNSRecord that was used. Remove tests the
referenced that var. Cleanup the rest.
* Rename function as well
* fixes
* middleware/authpath: Fix return from k8s mw
Return the correct search path from the kubernetes' AutoPath function.
Based on preliminary discussion in #870
* PodWithIP can be private
Fix and add docs to functions.
* CR: remove the error from AutoPathFunc
* middleware/kubernetes: pull TXT out of parseRequest
Put the TXT handling one layer higher and remove it from parseRequest.
Also rename the podsvc field in there to podOrSvc. Now that it isn't
used anymore for TXT record (dns-version) that was put in there. We can
make this a boolean (in a future PR).
Make parseRequest get an optional Zone that is from state.Zone and use
that instead of its own code. Removed some tests and other smaller
cleanups.
Fixes#836
* add this reverse
* another check
* readd
* Rename to kPod and kService for some clarity
Factor out as much of autopath into a subpackage as possible right now.
apw.Sent is not needed, we should see this from the rcode returned by
the middleware. See #852 on why this was needed.
Disable the tests for now as to not break the main build.
Put the autopath stuff in a separate sub package. Tests are still
included in the main kubernetes directory.
Next steps (after this is merged), is pulling the autopath handling
into the subpackage and fixing the tests.
Define two consts Pod and Svc, makes it stand out a little more
when used in switches in case.
We have opted for a new type, but then you need to convert them
all the time with string(Foo).
* Treat absence of port/service in SRV as wildcard
Normally, a SRV-request should have the form
_<service>._<port>.<name>.<zone>. The k8s peer-finder which is used for
bootstrapping by some applications will however query for SRV at
<name>.<zone>.
To compensate for this behaviour, treat the absence of _<service> and
_<port> as wildcards.
* Modified tests with new SRV behaviour
Added a testcase for a SRV request without port & service
Removed now valid query from invalidSRVQueries
* Forgot to run gofmt on test/kubernetes_test.go
Drop the interfaceAddr interfaces and just use a function. Cleanup
all fallout from that. Remove the use of global variables and cleanup
the tests a bit.
* Add unit tests & cnames
* more progress
* fix
* next mw dependent unit tests
* add tests for OnNXDOMAIN
* Add AAAA and ndots unit tests; fix request.NewWithQuestion
* Correct default value in README
* add CNAMEs to readme
* review
* fix autopath examples
* fix and test CNAME response order
* cleanup: go vet and golint run
Various cleanups trickered by go vet and golint.
* Fix tests and lowercase all errors
Lowercase all errors, some tests in kubernetes use errors from
kubernetes which do start with a capital letter.
* Add external service cnames
* remove cruft
* update CI k8s version
* change CI k8s version
* min k8s ver for ext services
* trying k8s 1.5
* k8s 1.5 requires ports spec
* remove kruft
* update dns schema version
* commit for testing in cluster
* commit for testing in cluster
* refactor and add ns.dns record
* Release 007
* reduce heap allocations
* gofmt
* revert accidental Makefile commits
* restore prior rcode for disabled pod mode
* revert Makefile deltas
* add unit tests
* more unit tests
* make isRequestInReverseRange easier to test
* more unit tests
* addressing review feedback
* commit setup.go
* Add fallthrough support for Kubernetes
This enables registering other services in the same zone as
Kubernetes services. This also re-orders the middleware chain
so that Kubernetes comes before other types, in order to make
this work out-of-the-box.
* Remove extra line
* dont require/allow "_" prefix for srv wildcard fields
* streamline parse/validation of req name
* removing nametemplate
* error when zone not found, loopify unit tests