Skip to content

externalName not using stubDomains settings #131

@iamrandys

Description

@iamrandys

When creating an externalName and the hostname provided is only resolvable when using stubDomains, the new service is not resolvable.

For example, if we setup stubDomains using the kube-dns config map, we are able to resolve subdomains of my-domain.com (such as xyz.my-domain.com) in our applications. This works great.

apiVersion: v1
kind: ConfigMap
metadata:
  name: kube-dns
  namespace: kube-system
data:
  stubDomains: |
    {"my-domain.com": ["172.111.111.111", "172.111.111.111"]}

When we try to create an externalName service using a domain that is only resolvable with the help of stubDomains, the service is created, but the service is not resolvable.

kubectl create service externalname my-service --external-name xyz.my-domain.com
kubectl exec -ti busybox -- nslookup my-service

Server:    100.64.0.10
Address 1: 100.64.0.10 kube-dns.kube-system.svc.cluster.local

nslookup: can't resolve 'my-service'

When I add the domain, xyz.my-domain.com, to the VPCs Route53 then the service is resolved and the externalName service works as expected.

kubectl create service externalname my-service --external-name xyz.my-domain.com
kubectl exec -ti busybox -- nslookup my-service

Server:    100.64.0.10
Address 1: 100.64.0.10 kube-dns.kube-system.svc.cluster.local

Name:      my-service
Address 1: 10.xxx.xxx.xxx

I'm would expect that the same stubDomains setting be used when creating externalName services.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions