Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubernetes service external-name link to another namespaces service not work. #2038

Closed
BSWANG opened this issue Aug 20, 2018 · 1 comment · Fixed by #2040
Closed

Kubernetes service external-name link to another namespaces service not work. #2038

BSWANG opened this issue Aug 20, 2018 · 1 comment · Fixed by #2040

Comments

@BSWANG
Copy link
Contributor

BSWANG commented Aug 20, 2018

kubernetes plugin can not resolve service which using externalName to link another service. I guess this issue is similar to #1866 .

Cluster using kubedns cannot reproduce this issue.

How to reproduce

➜  kubectl get svc  # there is a service in default namespace named `kubernetes`
NAME          TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
kubernetes    ClusterIP   172.21.0.1     <none>        443/TCP    9d

➜  kubectl create -f -<<EOF # create a service link to service in default namespace
heredoc> kind: Service
apiVersion: v1
metadata:
  name: servicetest
  namespace: testdns
spec:
  type: ExternalName
  externalName: kubernetes.default.svc.cluster.local
heredoc> EOF
service "servicetest" created

➜  kubectl run -it --image registry.aliyuncs.com/wangbs/netdia --namespace testdns --rm busybox 
If you don't see a command prompt, try pressing enter.
/ # ping kubernetes.default.svc.cluster.local # `kubernetes` service can resolved directly
PING kubernetes.default.svc.cluster.local. (172.21.0.1): 56 data bytes
^C
--- kubernetes.default.svc.cluster.local. ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

/ # ping servicetest.testdns.svc.cluster.local # service linked to `kubernetes` cannot resolved
ping: bad address 'servicetest.testdns.svc.cluster.local'

kubernetes version && coredns version

k8s=1.10.4
coredns=1.2.0

BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 21, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 22, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 22, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 22, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 23, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 23, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 23, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 23, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 24, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 24, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
BSWANG added a commit to BSWANG/coredns that referenced this issue Aug 24, 2018
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
chrisohaver pushed a commit that referenced this issue Aug 25, 2018
fix #2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
devguyio pushed a commit to devguyio/knative-docs that referenced this issue Feb 4, 2019
Due to a bug in CoreDNS that is fixed only in a version that ships
on MiniKube when installing Kubernetes v1.12 or newer. See
coredns/coredns#2038

Fixes: knative/serving#3067
bbrowning pushed a commit to bbrowning/coredns that referenced this issue Feb 5, 2019
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
@PFacheris
Copy link

Just an additional note here, I upgraded to 1.3.1 in my EKS cluster and was still getting SERVFAIL for this use-case. I resolved it by updating the upstream configuration in the kubernetes block of my Corefile from:

kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods insecure
      upstream
      fallthrough in-addr.arpa ip6.arpa
    }

to

kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods insecure
      upstream /etc/resolv.conf
      fallthrough in-addr.arpa ip6.arpa
    }

I'm not sure why the behavior described in the docs for upstream did not work for me:

If no ADDRESS is given, CoreDNS will resolve External Services against itself.

mdgreenfield pushed a commit to DataDog/coredns that referenced this issue Mar 4, 2019
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
devguyio pushed a commit to devguyio/knative-docs that referenced this issue Mar 8, 2019
Due to a bug in CoreDNS that is fixed only in a version that ships
on MiniKube when installing Kubernetes v1.12 or newer. See
coredns/coredns#2038

Fixes: knative/serving#3067
devguyio pushed a commit to devguyio/knative-docs that referenced this issue Mar 11, 2019
Due to a bug in CoreDNS that is fixed only in a version that ships
on MiniKube when installing Kubernetes v1.12 or newer. See
coredns/coredns#2038

Fixes: knative/serving#3067
knative-prow-robot pushed a commit to knative/docs that referenced this issue Mar 12, 2019
Due to a bug in CoreDNS that is fixed only in a version that ships
on MiniKube when installing Kubernetes v1.12 or newer. See
coredns/coredns#2038

Fixes: knative/serving#3067
Jason-ZW pushed a commit to rancher/coredns that referenced this issue Apr 17, 2019
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
dna2github pushed a commit to dna2fork/coredns that referenced this issue Jul 19, 2019
fix coredns#2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants