coredns / kubernetai

Multiple Kubernetes in CoreDNS
Apache License 2.0
97 stars 27 forks source link

Does it work with CoreDNS v 1.11.1 (latest) ? #54

Open Subetov opened 6 months ago

Subetov commented 6 months ago

Does Kubernetai plugin work with CoreDNS v1.11.1 (latest) ?

Resolving doesn't work for some reason. Same configuration works well with CoreDNS-1.8.0

.:53 {
    errors
    health {
        lameduck 5s
    }
    ready
    kubernetai cluster.local in-addr.arpa ip6.arpa {
      ignore empty_service
      pods verified
      fallthrough cluster.local in-addr.arpa ip6.arpa
    }
    kubernetai cluster.local in-addr.arpa ip6.arpa {
        endpoint https://10.99.120.1
        kubeconfig /kubeconfigs/dc1/config dc1
        pods verified
        ignore empty_service
        fallthrough in-addr.arpa ip6.arpa cluster.local
    }
    kubernetai cluster.local in-addr.arpa ip6.arpa {
        endpoint https://10.99.220.1
        kubeconfig /kubeconfigs/dc2/config dc2
        pods verified
        ignore empty_service
        fallthrough in-addr.arpa ip6.arpa
    }
    prometheus :9153
    forward . /etc/resolv.conf {
      prefer_udp
    }
    cache 30
    loop
    reload
    loadbalance
}

Thanks.

chrisohaver commented 6 months ago

It’s expect to. There haven’t been any changes I can think of that would prevent it, but it hasn’t been tested.

pal-sanich commented 5 months ago

It looks it doesn't:

CoreDNS-1.11.3 linux/amd64, go1.21.10,

.:53 {
    errors
    health {
        lameduck 5s
    }
    ready
    log
    debug
    kubernetes cluster.kubernetes {  ## This one works
        endpoint https://endpoint.example.com
        kubeconfig ./kubeconfig testcontext
        fallthrough in-addr.arpa ip6.arpa
    }
    kubernetai cluster.kubernetai {   ## This one doesn't work
        endpoint https://endpoint.example.com
        kubeconfig ./kubeconfig testcontext
        fallthrough in-addr.arpa ip6.arpa
    }
    forward . /etc/resolv.conf
...

The 'kubernetes' plugin works as espected, but 'kubernetai' doesn't work returning

[INFO] 127.0.0.1:43785 - 25714 "A IN origin.video.svc.cluster.kubernetes. udp 76 false 1232" NOERROR qr,aa,rd 104 0.000346972s
[INFO] 127.0.0.1:49382 - 61026 "A IN origin.video.svc.cluster.kubernetai. udp 76 false 1232" NXDOMAIN qr,rd,ra 128 0.168981812s

Thanks

pal-sanich commented 5 months ago

It looks it doesn't: ... Thanks

I've rebuild CoreDNS using latest commit (https://github.com/coredns/coredns/commit/621ffde538e57772783f9e4a0df590d2f0d71beb) and it helps:

...
    kubernetes cluster.kubernetes {  ## kubernetes plugin: works
        endpoint https://endpoint.example.com
        kubeconfig ./kubeconfig testcontext
        fallthrough in-addr.arpa ip6.arpa
    }
    kubernetai cluster.kubernetai {   ## kubernetai plugin: works
        endpoint https://endpoint.example.com
        kubeconfig ./kubeconfig testcontext
        fallthrough in-addr.arpa ip6.arpa
    }
    kubernetai cluster.kubernetai2 {   ## kubernetai 2nd plugin: works
        endpoint https://endpoint.example.com
        kubeconfig ./kubeconfig testcontext
        fallthrough in-addr.arpa ip6.arpa
    }
...    
[INFO] 127.0.0.1:48214 - 36487 "A IN origin.video.svc.cluster.kubernetes. udp 76 false 1232" NOERROR qr,aa,rd 104 0.000301923s
[INFO] 127.0.0.1:59248 - 3637 "A IN origin.video.svc.cluster.kubernetai. udp 76 false 1232" NOERROR qr,aa,rd 104 0.000279854s
[INFO] 127.0.0.1:55238 - 51214 "A IN origin.video.svc.cluster.kubernetai2. udp 77 false 1232" NOERROR qr,aa,rd 106 0.000309467s