Does the Kubernetes support for DNS SRV lookups allow for a Service using externalName and if so, how to allow a pod access to that record? The use case I have is an externally provided service where a third party defines the port number and I'd like to represent that in the same place as the CNAME, i.e. the k8s Service.
I had go using a simple nslookup query inside a pod with dnsPolicy
set to ClusterFirst
and it seems to work for the default kubernetes service which is internal:
x nslookup -type=SRV _https._tcp.kubernetes.default.svc
Server: 10.3.0.10
Address: 10.3.0.10#53
_https._tcp.kubernetes.default.svc.cluster.local service = 10 100 443 kubernetes.default.svc.cluster.local.
But I tried with one of my own Services which uses externalName
plus a named port and it cannot be found.
I'm using k8s 1.6.1 and kube-dns 1.9 (admittedly 1.9 is a bit "old", I will upgrade it shortly).