aboutsummaryrefslogtreecommitdiff
path: root/middleware/kubernetes/setup.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-22mw/kubernetes: Rewrite parseRequest and Readability improvements (#939)Gravatar Miek Gieben 1-8/+6
* mw/kubernetes: rewrite parseRequest Stop looking at the qtype in parseRequest and make k.Namespace a map. Fallout from this is that pkg/strings as it is not used anymore. Also add a few helper functions to make unexposed namespaces easier to see in the code. Add wildcard tests to the middleware tests. * Fix tests Add a whole bunch of comments to document what we are trying to do. * This is now answered * up coverage * duh * Update testcase * Make it nodata
2017-08-22core: hide registerHandler (#964)Gravatar Miek Gieben 1-3/+0
* core: hide registerHandler Remove RegisterHandler and just make it implicit when we look at the handler compilation step. * Rename GetHandler to just Handler Update callers and make auto check Hander in OnStartup. * Up test coverage in erratic * up test coverage
2017-08-18mw/federation: add federation back as separate mw for k8s (#929)Gravatar Miek Gieben 1-2/+1
* mw/federaration This PR add the federation back as a middleware to keep it more contained from the main kubernetes code. It also makes parseRequest less import and pushes this functionlity down in the k.Entries. This minimizes (or tries to) the importance for the qtype in the query. In the end the qtype checking should only happen in ServeDNS - but for k8s this might proof difficult. Numerous other cleanup in code and kubernetes tests. * up test coverage
2017-08-16Reverse in k8s (#923)Gravatar Miek Gieben 1-1/+3
* mw/kubernetes: reverse zone in ZONE stanza not parsed Properly parse the reverse zone syntax in the ZONES stanza as promised in the README. As short test case to test. * add test
2017-08-14mw/kubernetes: remove federation and cidr (#916)Gravatar Miek Gieben 1-124/+94
* 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
2017-08-11mw/k8s: cleanups (#893)Gravatar Miek Gieben 1-8/+4
* 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
2017-08-11Use server block defaults (#894)Gravatar Miek Gieben 1-4/+0
* mw/k8s: Test Federation parsing The test case was there, but there was nothing testing it?!?!?! Add it and split it out of the main setup test which is too long already. Also allow kubernetes a not have a ZONE, just default to the serverblock in that case. Remove test that was blocking that. Cleanup up the readme more. * rewrite README
2017-08-10Support multiple k8s api servers specification and load balance among api ↵Gravatar Yong Tang 1-1/+9
servers (#820) * 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>
2017-08-10core: replace GetMiddleware (#885)Gravatar Miek Gieben 1-0/+3
* core: replace GetMiddleware See the discussion in #881. GetMiddleware would add a `nil` middleware to the callstack thereby breaking functionality. This PR drops it in favor of RegisterHandler which is a completely standalone registry for middleware that want to let it self know to other middleware. Currenly *autopath* uses this to call *kubernetes*'s AutoPath method for dynamic autopathing. * Drop GetMiddleware * Register metrics * drop the panic
2017-08-10mw/kubernetes: remove subzones (#878)Gravatar Miek Gieben 1-5/+7
Only use was in k8s middleware; no tests other than subzone_test.go existed; not exercised: remove.
2017-08-10middleware/authpath: Fix return from k8s mw (#871)Gravatar Miek Gieben 1-0/+11
* 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
2017-08-09mw/authpath: hook in kubernetees (#860)Gravatar Miek Gieben 1-4/+3
Call out to kubernetes to get the search path - this still needs to return something sensible, but all infrastructure has landed to make it work.
2017-08-09WIP: autopath as middleware (#859)Gravatar Miek Gieben 1-43/+0
autopath as middleware
2017-08-08mw/kubernetes: warn about deprecating cidr (#858)Gravatar Miek Gieben 1-0/+5
Add log statement pointing to replacement. remove cidr from README and use replacement syntax. Fixes #851
2017-08-07middleware/kubernetes: autopath in sub package (#848)Gravatar Miek Gieben 1-11/+11
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.
2017-08-06all: gometalinter (#843)Gravatar Miek Gieben 1-1/+0
* kubernetes/reverse: remove deadcode * deadcode in errors and kubernetes removed * unnecessary conversion * constants * proxy: time.Since() * simplications * static check * Disable test/external_test
2017-08-03middleware/kubernetes: cleanup (#818)Gravatar Miek Gieben 1-4/+4
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.
2017-07-11k8s/autopath: Add CNAMES (#771)Gravatar Chris O'Haver 1-1/+2
* 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
2017-06-28middleware/kubernetes: Server side path lookups (#750)Gravatar Chris O'Haver 1-2/+48
* initial commit * add config options * add readme * rewording * revert unlreated change * normalize host domain path * add ndots opt, allow > 1 host domains, pull host domains from resolv.conf * implementing review feedback * update readme * use dns lib, config format, defaults * Correct autopath example.
2017-06-14cleanup: go vet and golint run (#736)Gravatar Miek Gieben 1-8/+6
* 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.
2017-06-14middleware/kubernetes: Implement current federation beta (#723)Gravatar Chris O'Haver 1-0/+13
* federation initial commit * UTs/bugfixes * federation bits * polish, cover UT gaps * add TODO * go fmt & todo note * remove unrelated change * pr changes * start node watcher * get real node name * remove unused case
2017-06-02unexpose InterfaceAddrser (#693)Gravatar Chris O'Haver 1-1/+1
2017-05-30Add k8s external service CNAMEs (#677)Gravatar Chris O'Haver 1-0/+12
* 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
2017-05-22Handle K8s middleware NS record (#662)Gravatar Chris O'Haver 1-2/+5
* 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
2017-04-19Add fallthrough support for Kubernetes (#626)Gravatar John Belamaric 1-0/+7
* 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
2017-02-22Golint (#548)Gravatar Miek Gieben 1-2/+2
* linter fixes * Golint and format code * fmt
2017-02-22Fix import path `github.com/miekg/coredns` -> `github.com/coredns/coredns` ↵Gravatar Yong Tang 1-2/+2
(#547) This fix fixes import path from `github.com/miekg/coredns` -> `github.com/coredns/coredns`
2017-02-02k8s middleware add tests and docs update (#501)Gravatar Chris O'Haver 1-2/+2
* add cidrs opt * remove state data from middleware object * update k8s docs * Add integration tests * add unit tests for cidr and pods config * more README fixes, separate dev notes * adjust section headers * fix typo
2017-02-01Allow cidr based reverse zone config (#500)Gravatar Chris O'Haver 1-0/+15
* add cidrs opt * remove state data from middleware object
2017-01-20Add pod cache and verified pod responses (#483)Gravatar Chris O'Haver 1-2/+2
* Add pod cache and verified pod responses * add ip indexing for pod cache
2017-01-15dont require/allow "_" prefix for srv wildcard fields (#472)Gravatar Chris O'Haver 1-16/+0
* dont require/allow "_" prefix for srv wildcard fields * streamline parse/validation of req name * removing nametemplate * error when zone not found, loopify unit tests
2017-01-11Add insecure A records for pods (#475)Gravatar Chris O'Haver 1-0/+15
2016-11-15K8s Test Cleanup and Service PTRGravatar John Belamaric 1-0/+13
Change the CI setup for K8s to be simpler. Now it just creates a set of objects via a yaml file, making it very easy to modify the tests. Implement PTR for services.
2016-11-09Add type to default templateGravatar Chris O'Haver 1-1/+1
2016-11-05Fix k8s client (#379)Gravatar John Belamaric 1-1/+1
* Fix k8s client to use client-go * Fix Kubernetes Build Issue The client-go code requires you to vendor. I have done a hack here in the Makefile to vendor it to version 1.5. But looks like we will need to do this the 'right' way soon. * Convert v1 to api Objects in List Functions Also removed the endpoint controller which was not used for anything. The Watch functions may still need the same treatment. * Vendor client-go release-1.5 * Fix basic SRV feature This is actually not serving SRV records correctly, but this should get it to work as it did prior to the k8s client changes. Another fix will be needed to serve SRV records as defined in the spec. * Add additional output in test result Add the response to the test output. * Fix erroneous test data
2016-10-12cleanups: go vet/golint (#331)Gravatar Miek Gieben 1-1/+1
Go vet and golint the new code once again. Drop Name from NameTemplate - it's cleaner: nametemplate.Template.
2016-09-23Add TLS support for k8s middleware (#289)Gravatar Chris O'Haver 1-5/+12
* Added TLS to k8s client Added options for TLS kubernetes client connection. * Fix k8s TLS config option parsing Brings config option parsing for kubernetes TLS in line with recent changes. * Put TLS config on one line Put kubernetes tls config on one line to match style established in etcd tls config. * Add tls option to README
2016-09-23Lint k8s middlewareGravatar Manuel de Brito Fontes 1-28/+23
2016-09-21Run golint and go vet (#276)Gravatar Miek Gieben 1-2/+2
Cleanup the errors and removed deadcode along the way. The leaves some error laying around, mostly about commenting exported identifier. We should look hard if those really are needed.
2016-09-19Cleanups and tests (#272)Gravatar Miek Gieben 1-1/+1
For some reasons there was a dnsserver/middleware.go that defined the middleware handlers. This code was a repeat from middleware/middleware.go. Removed dnsserver/middleware.go and replaced all uses of dnsserver.Middleware with middleware.Middleware. Added dnsserver/address_test.go to test the zone normalization (and to improve the test coverage). The deleted file will also improve the test coverage :)
2016-09-10Startup notification (#250)Gravatar Miek Gieben 1-2/+2
Stop the caddy message and start our own init notifications. Log the version of CoreDNS when starting up. Fix all middleware's setup functions so that return the error prefixed with *which* middleware was failing; leads to better debuggable errors when starting up.
2016-09-07Cleanup: put middleware helper functions in pkgs (#245)Gravatar Miek Gieben 1-1/+1
Move all (almost all) Go files in middleware into their own packages. This makes for better naming and discoverability. Lot of changes elsewhere to make this change. The middleware.State was renamed to request.Request which is better, but still does not cover all use-cases. It was also moved out middleware because it is used by `dnsserver` as well. A pkg/dnsutil packages was added for shared, handy, dns util functions. All normalize functions are now put in normalize.go
2016-08-19Make CoreDNS a server type plugin for Caddy (#220)Gravatar Miek Gieben 1-0/+140
* Make CoreDNS a server type plugin for Caddy Remove code we don't need and port all middleware over. Fix all tests and rework the documentation. Also make `go generate` build a caddy binary which we then copy into our directory. This means `go build`-builds remain working as-is. And new etc instances in each etcd test for better isolation. Fix more tests and rework test.Server with the newer support Caddy offers. Fix Makefile to support new mode of operation.