I have an NGINX in front of several PODs, exposed through ClusterIP: none.
NGINX is forwarding traffic to these nodes like that:
upstream api {
server my-api:1066;
}
Will this configuration distribute traffic evenly among all PODs behind the my-api
hostname? Will failing PODs be removed from the hostname resolution?
The default traffic distribution for Kubernetes services is random based on the default proxy mode: iptables. (This is likely your case)
In very old Kubernetes versions (<1.1) the default proxy mode: userspace would default to round-robin (you can still switch to that mode if you'd like to)
The newer way (< 1.8) of doing round robin (optionally) is to use proxy mode: ipvs.
You can also look at other solutions like Cillium that provide load balancing capabilities.