mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
Adding wildcard support (#190)
* 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
This commit is contained in:
committed by
Miek Gieben
parent
319d30697a
commit
3f4ec783d2
@@ -7,6 +7,7 @@ are constructed as "myservice.mynamespace.coredns.local" where:
|
||||
* "mynamespace" is the k8s namespace for the service, and
|
||||
* "coredns.local" is the zone configured for `kubernetes`.
|
||||
|
||||
The record name format can be changed by specifying a name template in the Corefile.
|
||||
|
||||
## Syntax
|
||||
|
||||
@@ -36,6 +37,10 @@ This is the default kubernetes setup, with everything specified in full:
|
||||
kubernetes coredns.local {
|
||||
# Use url for k8s API endpoint
|
||||
endpoint http://localhost:8080
|
||||
# Assemble k8s record names with the template
|
||||
template {service}.{namespace}.{zone}
|
||||
# Only expose the k8s namespace "demo"
|
||||
namespaces demo
|
||||
}
|
||||
# cache 160 coredns.local
|
||||
}
|
||||
@@ -247,7 +252,7 @@ return the IP addresses for all services with "nginx" in the service name.
|
||||
|
||||
TBD:
|
||||
* How does this relate the the k8s load-balancer configuration?
|
||||
* Do wildcards search across namespaces?
|
||||
* Do wildcards search across namespaces? (Yes)
|
||||
* Initial implementation assumes that a namespace maps to the first DNS label
|
||||
below the zone managed by the kubernetes middleware. This assumption may
|
||||
need to be revised.
|
||||
@@ -344,4 +349,5 @@ TBD:
|
||||
and A-record queries. Automate testing with cache in place.
|
||||
* Automate CoreDNS performance tests. Initially for zone files, and for
|
||||
pre-loaded k8s API cache.
|
||||
* Automate integration testing with kubernetes.
|
||||
* Automate integration testing with kubernetes. (k8s launch and service start-up
|
||||
automation is in middleware/kubernetes/tests)
|
||||
|
||||
Reference in New Issue
Block a user