aboutsummaryrefslogtreecommitdiff
path: root/middleware/kubernetes (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-02-01Allow cidr based reverse zone config (#500)Gravatar Chris O'Haver 3-1/+33
* add cidrs opt * remove state data from middleware object
2017-01-29Fix `go fmt`, `go lint`, and `go vet` issues (#494)Gravatar Yong Tang 2-12/+16
This fix fixes several `go fmt`, `go lint`, and `go vet` issues, to make goreportcard happy: https://goreportcard.com/report/github.com/miekg/coredns Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-23correct k8s name parsing response codes (#493)Gravatar Chris O'Haver 1-20/+14
2017-01-22only a * by itself is wild (#488)Gravatar Chris O'Haver 2-4/+4
2017-01-20Add pod cache and verified pod responses (#483)Gravatar Chris O'Haver 3-6/+98
* Add pod cache and verified pod responses * add ip indexing for pod cache
2017-01-15Add txt response per k8s specGravatar Chris OHaver 1-4/+30
2017-01-15dont require/allow "_" prefix for srv wildcard fields (#472)Gravatar Chris O'Haver 8-584/+229
* 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-12Pod insecure2 (#479)Gravatar Chris O'Haver 1-1/+1
* return servfail for pod rqsts when pods disabled * Add integration test for disabled pod mode
2017-01-11Add insecure A records for pods (#475)Gravatar Chris O'Haver 3-17/+98
2017-01-05handle A/PTR/SRV for headless services/endpoints (#464)Gravatar Chris O'Haver 1-52/+201
* handle A/PTR/SRV for headless services/endpoints * error early if _proto will produce nothing * remove wc params + various style tweaks * Release 004 * handle A/PTR/SRV for headless services/endpoints * error early if _proto will produce nothing * remove wc params + various style tweaks * optimize srv prefix validation * poking travis * reduce response sizes, clean func params
2016-12-20Add middleware.NextOrFailure (#462)Gravatar Miek Gieben 1-6/+3
This checks if the next middleware to be called is nil, and if so returns ServerFailure and an error. This makes the next calling more robust and saves some lines of code. Also prefix the error with the name of the middleware to aid in debugging.
2016-12-14Return no items if less than 3 items in service segmentsGravatar Dmytro Kislov 1-0/+3
2016-12-02Add A lookup for headless services (#451)Gravatar Chris O'Haver 2-6/+81
2016-11-15K8s Test Cleanup and Service PTRGravatar John Belamaric 2-1/+21
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-14Fix several typos in docs. (#426)Gravatar Yong Tang 2-2/+2
Fixes several typos in docs. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-13Fix various issues with formatting and typos (#424)Gravatar Michael Grosser 2-4/+4
* Fix typos * Simplify code * Fix error usage
2016-11-11More idiomatic GoGravatar Miek Gieben 1-5/+5
2016-11-10Return NXDOMAIN when no items match query (#422)Gravatar Chris O'Haver 1-5/+7
* When no records match, reply with NXDOMAIN * Implement in IsNameError * case for unexposed namespace. k8s integation tests * Fix imports order. Lower case of err strs.
2016-11-09Add type to default templateGravatar Chris O'Haver 3-16/+16
2016-11-07middleware/file|auto: Notifies and AXFR (#399)Gravatar Miek Gieben 1-19/+19
Be more explicit in the logs when a notify fails. New notify error message looks like: 2016/11/07 18:21:42 [ERROR] Notify for zone "example.org." was not accepted by "8.8.8.8:53": rcode was "SERVFAIL" Correctly pick up secondaries When multiple secondary are specified make sure they are picked up. Fixes #393 #398
2016-11-07Fix Kubernetes Watches (#392)Gravatar John Belamaric 1-2/+39
The watchers were still trying to process raw v1 objects which failed to be added to the store. This meant new services and namespaces created after CoreDNS started would not be discoverable. Add a filter function that converts watch events with v1 objects to events with api objects.
2016-11-07Fix compilation errorGravatar Miek Gieben 1-2/+2
2016-11-07Golint (#386)Gravatar Miek Gieben 1-6/+6
Lint and vet the curret code add docs about adding a git post-commit hook that performs these actions after each commit.
2016-11-05BackendService: add Reverse method (#381)Gravatar Miek Gieben 3-34/+22
Add a Reverse method to BackendService because different backends want to to do diff. things. This allows etc/k8s to share even more code and we can unify the PTR handling.
2016-11-05Fix k8s client (#379)Gravatar John Belamaric 4-68/+65
* 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-30ServiceBackend interface (#369)Gravatar Miek Gieben 3-316/+54
* Add ServiceBackend interface This adds a ServiceBackend interface that is shared between etcd/etcd3 (later) and kubernetes, leading to a massive reduction in code. When returning the specific records from their backend. Fixes #273
2016-10-30Fix k8s build (#373)Gravatar Manuel Alejandro de Brito Fontes 2-11/+11
2016-10-27golintGravatar Miek Gieben 2-3/+5
2016-10-26middleware/metrics: cleanup (#355)Gravatar Miek Gieben 1-0/+2
* middleware/metrics: add more metrics middleware/cache: Add metrics for number of elements in the cache. Also export the total size. Update README to detail the new metrics. middleware/metrics Move metrics into subpackage called "vars". This breaks the import cycle and is cleaner. This allows vars.Report to be used in the the dnsserver to log refused queries. middleware/metrics: tests Add tests to the metrics framework. The metrics/test subpackage allows scraping of the local server. Do a few test scrape of the metrics that are defined in the metrics middleware. This also allows metrics integration tests to check if the caching and dnssec middleware export their metrics correctly. * update README * typos * fix tests
2016-10-19Enable use of a service account in-cluster. (#349)Gravatar John Belamaric 1-0/+6
2016-10-14Add needed comments for `golint` cleanup. (#334)Gravatar Yong Tang 1-6/+10
This fix adds several needed comments in `middleware/kubernetes/nametemplate/nametemplate.go` to clean up golint output. There are still 3 places that needs proper docs: ``` middleware/kubernetes/nametemplate/nametemplate.go:64:1: comment on exported type Template should be of the form "Template ..." (with optional leading article) middleware/kubernetes/nametemplate/nametemplate.go:72:1: comment on exported method Template.SetTemplate should be of the form "SetTemplate ..." middleware/kubernetes/nametemplate/nametemplate.go:188:1: comment on exported type NameValues should be of the form "NameValues ..." (with optional leading article) ``` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-12cleanups: go vet/golint (#331)Gravatar Miek Gieben 5-45/+48
Go vet and golint the new code once again. Drop Name from NameTemplate - it's cleaner: nametemplate.Template.
2016-10-10docs: rewrite using manpage style (#327)Gravatar Miek Gieben 1-19/+19
This still needs cleanup, but this is a first pass the cleans some cruft and documents our style (in middleware.md) and makes all the docs match that style.
2016-10-08middleware/file: proper support for wildcard (#323)Gravatar Miek Gieben 1-3/+0
Add support for wildcard records, while taking care of wildcard-cnames and DNSSEC. Add enough tests to check all the corner cases.
2016-09-25Doc: add package docs (#296)Gravatar Miek Gieben 1-1/+1
* Doc: add package docs Add short package level docs to make godoc looks nicer. Add some badges to the README. * correct url
2016-09-23Add TLS support for k8s middleware (#289)Gravatar Chris O'Haver 3-12/+43
* 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-23Lister refactor kubernetes/kubernetes#33269Gravatar Manuel de Brito Fontes 2-29/+20
2016-09-23Remove unused const blockGravatar Manuel de Brito Fontes 1-8/+0
2016-09-23Refactoring of k8s helpersGravatar Manuel de Brito Fontes 6-111/+56
2016-09-23Golint2 (#280)Gravatar Miek Gieben 6-321/+28
* Fix linter errors * More linting fixes * More docs and making members private that dont need to be public * Fix linter errors * More linting fixes * More docs and making members private that dont need to be public * More lint fixes This leaves: ~~~ middleware/kubernetes/nametemplate/nametemplate.go:64:6: exported type NameTemplate should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:71:1: exported method NameTemplate.SetTemplate should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:108:1: exported method NameTemplate.GetZoneFromSegmentArray should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:116:1: exported method NameTemplate.GetNamespaceFromSegmentArray should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:120:1: exported method NameTemplate.GetServiceFromSegmentArray should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:124:1: exported method NameTemplate.GetTypeFromSegmentArray should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:135:1: exported method NameTemplate.GetSymbolFromSegmentArray should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:167:1: exported method NameTemplate.IsValid should have comment or be unexported middleware/kubernetes/nametemplate/nametemplate.go:182:6: exported type NameValues should have comment or be unexported middleware/kubernetes/util/util.go:1:1: package comment should be of the form "Package util ..." middleware/kubernetes/util/util.go:27:2: exported const WildcardStar should have comment (or a comment on this block) or be unexported middleware/proxy/lookup.go:66:1: exported method Proxy.Forward should have comment or be unexported middleware/proxy/proxy.go:24:6: exported type Client should have comment or be unexported middleware/proxy/proxy.go:107:1: exported function Clients should have comment or be unexported middleware/proxy/reverseproxy.go:10:6: exported type ReverseProxy should have comment or be unexported middleware/proxy/reverseproxy.go:16:1: exported method ReverseProxy.ServeDNS should have comment or be unexported middleware/proxy/upstream.go:42:6: exported type Options should have comment or be unexported ~~~ I plan on reworking the proxy anyway, so I'll leave that be.
2016-09-22Revert k8s changesGravatar Manuel de Brito Fontes 2-18/+28
2016-09-21Fix k8s build (#278)Gravatar Manuel Alejandro de Brito Fontes 2-29/+18
2016-09-21Run golint and go vet (#276)Gravatar Miek Gieben 2-3/+3
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-18fix typo (#268)Gravatar Shawn Smith 1-1/+1
2016-09-16Fix build error by change kubernetes controller to `pkg/client/cache` (#262)Gravatar Yong Tang 1-10/+9
Kubernetes moves informer and controller to pkg/client/cache, see: https://github.com/kubernetes/kubernetes/pull/32718 As a result, coredns build is broken. This fix fixes the build by making related change with kubernetes. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
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 4-70/+29
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-25Remove conf/ dirGravatar Miek Gieben 1-12/+32
Adjust documentation for k8s and put contents of the k8sCorefile in the README.md