How to Perform a SRV Look up in Kubernetes to use the port to perfom service call

11/5/2018

From this Stack Overflow answer I know that, a SRV look up can be performed to get the port of the kubernetes service. But exactly how do I perform that? How do I put it in my yml file? and when I do NSlook up

/ # nslookup  _main._tcp.account-service -type=srv
Server:         10.96.0.10
Address:        10.96.0.10#53

Non-authoritative answer:
_main._tcp.account-service.default.svc.cluster.local    canonical name = account-service.default.svc.cluster.local.
Name:   account-service.default.svc.cluster.local
Address: 10.103.238.155

I cannot see port either. The main port is pointing to 8082 btw.

-- Eugene R. Wang
kubernetes
microservices
srv

0 Answers