Multiple Kubernetes in CoreDNS
Switch branches/tags
Clone or download
nyodas and chrisohaver Get Full Kubernetai Zone Lists v2 (#16)
* Change Scrub expected values returned.

* [autopath] - works with multiple cluster.
Latest commit c3c5734 Dec 17, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
plugin/kubernetai Get Full Kubernetai Zone Lists v2 (#16) Dec 17, 2018
.gitignore Get Full Kubernetai Zone Lists v2 (#16) Dec 17, 2018
LICENSE Initial commit Feb 7, 2018
Makefile initial Makefile Feb 12, 2018
README.md Fix dead link (#10) Mar 21, 2018
main.go first stab Feb 12, 2018

README.md

kubernetai

Name

Kubernetai - serve multiple Kubernetes within a Server.

Description

Kubernetai (koo-ber-NET-eye) is the plural form of Kubernetes. In a nutshell, Kubernetai is an external plugin for CoreDNS that holds multiple kubernetes plugin configurations. It allows one CoreDNS server to connect to more than one Kubernetes server at a time.

With kubernetai, you can define multiple kubernetes blocks in your Corefile. All options are exactly the same as the built in kubernetes plugin, you just name them kubernetai instead of kubernetes.

Syntax

Identical to kubernetes.

Examples

For example, the following Corefile will connect to three different Kubernetes clusters.

. {
    errors
    log
    kubernetai cluster.local {
      endpoint http://192.168.99.100
    }
    kubernetai assemblage.local {
      endpoint http://192.168.99.101
    }
    kubernetai conglomeration.local {
      endpoint http://192.168.99.102
    }
}

fallthrough

Fallthrough in kubernetai will fall-through to the next kubernetai stanza (in the order they are in the Corefile), or to the next plugin (if it's the last kubernetai stanza).

Here is an example Corefile that makes two connections to a single minikube instance. Because both servers are actually the same server, they both have the same zone, which means that queries for cluster.local will always first get processed by the first stanza. The fallthrough in the first stanza allows processing to go to the next stanza if the service is not found.

. {
    errors
    log
    kubernetai cluster.local {
      endpoint http://192.168.99.100:8080
      namespaces default
      fallthrough
    }
    kubernetai cluster.local {
      endpoint http://192.168.99.100:8080
    }
}

The first kubernetai stanza exposes only the default namespace. When we query for a service in the default namespace, the kubernetes instance in the first stanza answers. When we query for a service in any other namespace, the first stanza falls through to the second, and the second connection answers.