aboutsummaryrefslogtreecommitdiff
path: root/test/kubernetes_test.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 1-1/+1
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat
2017-09-01mw/kubernetes: move fallthrough tests out (#1008)Gravatar Miek Gieben 1-346/+10
* mw/kubernetes: move fallthrough tests out Remove the testcase duplication and put fallthrough tests in separate file. Also make some names shorter and more descriptive. * fix test build * fix corefile
2017-08-30mw/kubernetes: split integration tests (#1004)Gravatar Miek Gieben 1-194/+48
* mw/kubernetes: split integration tests * separate file and test for api fallthrough, does not need all other servers to be started. * more split ups: make it clear when or when not we need an upstream server, as just needlessly start it in doIntegrationTests. * use identifiers from dns package -> "TypeSRV" -> dns.TypeSRV, as there is no need to reinvent these. * updates * deploy work-around * re-add weird sleep
2017-08-26mw/kubernetes: add configurable TTL (#995)Gravatar Miek Gieben 1-8/+5
* mw/kubernetes: add configurable TTL Add ttl option to kubernetes. This defaults to 5s but allows configuration to go up to 3600. Configure the tests so that a few actually check for the 5s, while the rest use the TTL of 303 which is ignored by the checking code. Fixes #935 * fix tests * and more
2017-08-25Reduce the test cases for kubernetes API proxy (#989)Gravatar Yong Tang 1-1/+11
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-24Remove createTestServer (#981)Gravatar Miek Gieben 1-26/+11
* Remove createTestServer * more cleanups * comment tweak * sort * sigh
2017-08-24Middleware/Kubernetes: Add RR check to K8s integration tests (#884)Gravatar Sandeep Rajan 1-86/+484
2017-08-23mw/kubernetes: remove kPod and kServices (#969)Gravatar Miek Gieben 1-1/+1
Based up on: #939, but redone in a new PR with some cherry-picked commits: aacb91ef0b927683b21d6ee39dbddbd001334854 5dc34247b7d0136d9fe035f6b10d6b3e14ee7f2c This removes kPod and Kservice and creates []msg.Service from k.findPods and k.findServices. Updated few tests which I *think* are correct; they look correct to me.
2017-08-22mw/kubernetes: Rewrite parseRequest and Readability improvements (#939)Gravatar Miek Gieben 1-4/+12
* 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-18mw/federation: add federation back as separate mw for k8s (#929)Gravatar Miek Gieben 1-1/+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-14mw/kubernetes: remove federation and cidr (#916)Gravatar Miek Gieben 1-151/+6
* 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-10Support multiple k8s api servers specification and load balance among api ↵Gravatar Yong Tang 1-1/+22
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-10WIP: Parserequest2 cutback (#868)Gravatar Miek Gieben 1-4/+4
* 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
2017-08-04Kubernetes srv (#823)Gravatar Markus Sommer 1-2/+5
* 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
2017-06-14handle clusterIP endpoint queries (#730)Gravatar Chris O'Haver 1-0/+10
2017-06-01Add SOA record to upstream zone file (#689)Gravatar Chris O'Haver 1-0/+1
2017-05-30Add k8s external service CNAMEs (#677)Gravatar Chris O'Haver 1-1/+52
* 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-0/+7
* 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-3/+56
* 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-22Fix import path `github.com/miekg/coredns` -> `github.com/coredns/coredns` ↵Gravatar Yong Tang 1-1/+1
(#547) This fix fixes import path from `github.com/miekg/coredns` -> `github.com/coredns/coredns`
2017-02-08Fix k8s chaining (#510)Gravatar Chris O'Haver 1-0/+30
* fix k8s next middleware chaining * add chain to integration tests * if nit
2017-02-07Fix k8s PTR when all namespaces exposed (#507)Gravatar Chris O'Haver 1-0/+47
* check for no namespace filter * integration test
2017-02-02k8s middleware add tests and docs update (#501)Gravatar Chris O'Haver 1-1/+85
* 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-01-23correct k8s name parsing response codes (#493)Gravatar Chris O'Haver 1-3/+3
2017-01-20Add pod cache and verified pod responses (#483)Gravatar Chris O'Haver 1-0/+25
* Add pod cache and verified pod responses * add ip indexing for pod cache
2017-01-15Add txt response per k8s specGravatar Chris OHaver 1-0/+7
2017-01-15dont require/allow "_" prefix for srv wildcard fields (#472)Gravatar Chris O'Haver 1-15/+15
* 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-22/+45
* return servfail for pod rqsts when pods disabled * Add integration test for disabled pod mode
2017-01-12Run tests in parallel (#478)Gravatar Miek Gieben 1-0/+1
Create a small speedup running the tests: PASS ok github.com/miekg/coredns/test 10.329s PASS ok github.com/miekg/coredns/test 6.079s Skip the etcd ones. Doing the middleware/*/*_test ones doesn't yield any speedup as these are still done on a per directory basis.
2017-01-11Add insecure A records for pods (#475)Gravatar Chris O'Haver 1-0/+13
2017-01-05handle A/PTR/SRV for headless services/endpoints (#464)Gravatar Chris O'Haver 1-25/+30
* 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-02Add A lookup for headless services (#451)Gravatar Chris O'Haver 1-0/+21
2016-11-15Fix reverse zone in corefileGravatar John Belamaric 1-1/+1
2016-11-15Change IPs to match hyperkubeGravatar John Belamaric 1-17/+17
2016-11-15K8s Test Cleanup and Service PTRGravatar John Belamaric 1-43/+74
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-10Return NXDOMAIN when no items match query (#422)Gravatar Chris O'Haver 1-123/+159
* 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-09Update k8s integration testsGravatar Chris O'Haver 1-24/+24
2016-11-05Fix k8s client (#379)Gravatar John Belamaric 1-7/+7
* 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-02middleware/cache: split cache in positive and negative and use lru (#298)Gravatar Miek Gieben 1-2/+2
Make the cache memory bounded, by using a LRU cache. Also split the cache in a positive and negative one - each with its own controls. Extend the cache stanza to allow for this: cache { positive limit [ttl] negative limit [ttl] } is now possible. This also add a cache_test.go in the toplevel test/ directory that exercises the caching path. Fixes #260
2016-09-27Cleanup Makefile and .travis.yml (#305)Gravatar Yong Tang 1-1/+1
This fix updates .travis.yml and Makefile for several places: - Remove unneeded `docker pull gcr.io/google_containers/hyperkube-amd64:v1.2.4` (only v1.3.7 was used) - Use docker to deploy etcd (insteadof downloading etcd binary). - Merge `make testk8s` and `make testk8s-setup` (no need to have multiple targets for a couple of tests) - Set version of etcd and kubernetes in .travis.yml (so that it is easy to update new version in the future) Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-23Fix k8s integration tests (#231)Gravatar Michael Richmond 1-18/+29
* Adding debug message when starting k8s controller * Adding work-around for timing issue in k8s integration tests * Remove unused import * Fix Makefile for ast package * Increase k8s verbosity in travis * Updating TODO list to find root cause of test issue * go fmt cleanup
2016-08-20Cleanup and fixes (#223)Gravatar Miek Gieben 1-13/+3
* Set version to 001 * Remove k8stest, test fails is k8s is not there: touch luck * Remove server directory: not used anymore * Disable k8s test (for now) * gometalinter changes
2016-08-19Make CoreDNS a server type plugin for Caddy (#220)Gravatar Miek Gieben 1-12/+17
* 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.
2016-07-27Fix Travis IPv6 and add k8s integration testing to CI (#194)Gravatar Michael Richmond 1-1/+1
Updating travis yaml file to: * Force IPv6 to work in their VM environment * Enable docker (requires VM environment and sudo) * Run kubernetes integration tests in Travis
2016-07-22Adding test cases for Corefile parsing (#193)Gravatar Michael Richmond 1-13/+5
Adding test cases for Corefile parsing. Some code refactoring to allow test reuse.
2016-07-14Adding wildcard support (#190)Gravatar Michael Richmond 1-0/+182
* Commenting out unused functions. TODO: remove when it is not needed * Update README with namespace and template example * Adding note about changing the record name format via a template * Adding test scripts to automate k8s startup * Automating k8s namespace creation * Adding automation to start 4 k8s services * Updating documentation for k8s tests * Avoid downloading kubectl if already exists * Adding debug statement when namespace is not exposed. * Adding basic kubernetes integration tests * Makefile now contains a "testk8s" target. This target requires k8s to be running. * Adding test/kubernetes_test.go file with a couple of basic A record tests. * Updating k8s integration tests to only run k8s integration tests * Adding support for namespace wildcards * Refactoring to move filtering logic to kubernetes.go file * go fmt fixes * Adding wildcard support for namespaces and service names * Kubernetes integration tests updated for A records. * Expanded record name assembly for answer section not yet implemented. * Refactoring to focus k8sclient code just on accessing k8s API. Filtering now handled in kubernetes.go * Adding wildcard test cases * Adding skydns startup script. (To allow side by side testing of wildcards.) * Commenting out record name assmebly based on NameTemplate. Need to improve template before this makes sense. * Adding basic SRV integration tests * Need to add verification for additional answer section * Fixing comments and formatting * Moving wildcard constants to vars * Travis test execution appears to be failing on access to these constants * Fixing access to util package * Trying to work around Travis test bug * Reverting to access kubernetes/util as "util" Travis breakage is due to "Infoblox-CTO" in src path