Adding resyncperiod to Corefile (#205)

* Removing old unused inline k8s API code and tests.
* Adding parsing implementation for `resyncperiod` keyword from Corefile.
* Adding tests for parsing `resyncperiod` keyword from Corefile.
8 Updating README.md and conf/k8sCorefile.
This commit is contained in:
Michael Richmond
2016-08-08 14:30:04 -07:00
committed by GitHub
parent 51eaefc037
commit c079de65b5
9 changed files with 123 additions and 965 deletions

View File

@@ -35,6 +35,9 @@ This is the default kubernetes setup, with everything specified in full:
.:53 {
# use kubernetes middleware for domain "coredns.local"
kubernetes coredns.local {
# Kubernetes data API resync period
# Example values: 60s, 5m, 1h
resyncperiod 5m
# Use url for k8s API endpoint
endpoint http://localhost:8080
# Assemble k8s record names with the template
@@ -42,10 +45,17 @@ This is the default kubernetes setup, with everything specified in full:
# Only expose the k8s namespace "demo"
namespaces demo
}
# cache 160 coredns.local
# Perform DNS response caching for the coredns.local zone
# Cache timeout is provided by the integer in seconds
#cache 180 coredns.local
}
~~~
Notes:
* If the `namespaces` keyword is omitted, all kubernetes namespaces are exposed.
* If the `template` keyword is omitted, the default template of "{service}.{namespace}.{zone}" is used.
* If the `resyncperiod` keyword is omitted, the default resync period is 5 minutes.
### Basic Setup
#### Launch Kubernetes
@@ -305,14 +315,9 @@ TBD:
* Performance
* Improve lookup to reduce size of query result obtained from k8s API.
(namespace-based?, other ideas?)
* Caching/notification of k8s API dataset. (See aledbf fork for
implementation ideas.)
* DNS response caching is good, but we should also cache at the http query
level as well. (Take a look at https://github.com/patrickmn/go-cache as
a potential expiring cache implementation for the http API queries.)
* Additional features:
* Reverse IN-ADDR entries for services. (Is there any value in supporting
reverse lookup records?)
reverse lookup records?) (need tests, functionality should work based on @aledbf's code.)
* How to support label specification in Corefile to allow use of labels to
indicate zone? (Is this even useful?) For example, the following
configuration exposes all services labeled for the "staging" environment
@@ -333,14 +338,6 @@ TBD:
flattening to lower case and mapping of non-DNS characters to DNS characters
in a standard way.)
* Expose arbitrary kubernetes repository data as TXT records?
* (done) ~~Support custom user-provided templates for k8s names. A string provided
in the middleware configuration like `{service}.{namespace}.{type}` defines
the template of how to construct record names for the zone. This example
would produce `myservice.mynamespace.svc.cluster.local`. (Basic template
implemented. Need to slice zone out of current template implementation.)~~
* (done) ~~Implement namespace filtering to different zones. That is, zone "a.b"
publishes services from namespace "foo", and zone "x.y" publishes services
from namespaces "bar" and "baz". (Basic version implemented -- need test cases.)~~
* DNS Correctness
* Do we need to generate synthetic zone records for namespaces?
* Do we need to generate synthetic zone records for the skydns synthetic zones?
@@ -352,7 +349,3 @@ TBD:
pre-loaded k8s API cache. With and without CoreDNS response caching.
* Try to get rid of kubernetes launch scripts by moving operations into
.travis.yml file.
* ~~Implement test cases for http data parsing using dependency injection
for http get operations.~~
* ~~Automate integration testing with kubernetes. (k8s launch and service
start-up automation is in middleware/kubernetes/tests)~~