Apply the below yaml file to create sgw-s11
service with static endpoint IPs
kubectl apply -f custom-dns.yaml
Verify DNS resolution
dig @10.96.0.10 sgw-s11.default.svc.cluster.local +short
This should return the two IPs specified in the Endpoints
section of the yaml
1.2.3.4
5.6.7.8
Since we are using named ports and specified the protocol in our Service
and Endpoint
spec,
SRV
records are automatically populated to discover the port too. E.g.,
dig @10.96.0.10 _s11._udp.sgw-s11.default.svc.cluster.local SRV
Notice the port 2123 under ANSWER SECTION
;; QUESTION SECTION:
;_s11._udp.sgw-s11.default.svc.cluster.local. IN SRV
;; ANSWER SECTION:
_s11._udp.sgw-s11.default.svc.cluster.local. 30 IN SRV 10 50 2123 cp-0.sgw-s11.default.svc.cluster.local.
_s11._udp.sgw-s11.default.svc.cluster.local. 30 IN SRV 10 50 2123 cp-1.sgw-s11.default.svc.cluster.local.
;; ADDITIONAL SECTION:
cp-0.sgw-s11.default.svc.cluster.local. 30 IN A 1.2.3.4
cp-1.sgw-s11.default.svc.cluster.local. 30 IN A 5.6.7.8