I have several services that need to connect to each other’s web port behind an ingress, and if I tell them to connect via their standard FQDN (ex. foo.baz.com) DNS returns the 2 IPs of the load balancer both of these services is behind.
Each node in my cluster can only connect to one of these load balancer IPs, so about half of the requests fail. In the past we’ve worked around this by using the k8s internal DNS names (ex. foo-service.foo-namespace), but some applications more strictly rely on the hostname to match their external FQDN
We’ve found that if we make an entry in the /etc/hosts on each pod to point to the right load balancer IP, this addresses the issue, but this seems like there is probably a better way to go about doing this?
Thanks in advance!
Cluster information:
Kubernetes version: 1.15.11
Cloud being used: EKS
Installation method: terraform
Host OS: amazon linux
CNI and version: amazon-k8s-cni:v1.5.3