Traffic to a new Service of `type: ExternalName` pointing to an RDS hostname fails with "connection refused" on the expected port.
IntermediateTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer
Likely causes → ExternalName only creates a DNS CNAME. It does no port mapping and no proxying, so the ports in the Service are ignored; the client must use the real port. HTTP clients also send the Service name as Host, which some backends reject.
Diagnose →
kubectl get svc db -o jsonpath='{.spec.externalName}{"\n"}'
kubectl run dns --rm -it --image=busybox:1.36 --restart=Never -- nslookup db.data.svc.cluster.local
Fix → Connect to db.data.svc.cluster.local:5432 (the real RDS port). If you need port remapping, use a selector-less Service with a manual EndpointSlice pointing at IPs (not ideal for RDS whose IPs change).
Prevent → Use ExternalName only as a DNS alias, and document the real port.
More on Services, DNS, Ingress and NetworkPolicy
`curl http://orders.shop.svc.cluster.local` hangs, and `kubectl get endpointslices -l kubernetes.io/service-name=orders` shows `ENDPOINTS <unset>`.BeginnerEndpoints exist, but `curl orders:80` returns `Connection refused`.BeginnerA Service works when you curl the Pod IP but times out on the ClusterIP from every node.IntermediateInside a Pod, `nslookup orders` returns `;; connection timed out; no servers could be reached`.BeginnerCoreDNS Pods are in CrashLoopBackOff with `[FATAL] plugin/loop: Loop (127.0.0.1:41823 -> :53) detected for zone "."`.IntermediateCalls to `api.stripe.com` from Pods are slow, and CoreDNS logs show `api.stripe.com.payments.svc.cluster.local`, `api.stripe.com.svc.cluster.local` … all `NXDOMAIN`.Intermediate