Assuming this scenario:
Service A (ClusterIP):
Service B (ClusterIP):
Assuming that I have an Ingress Controller:
/svcA > This will redirect to Service A /svcB > This will redirect to Service B
So my question is, the Service is still doing a Load Balancing between the pods? What if Pod1 of Service A is busy and the request has to be attender by either Pod2 or Pod3 of Service A ?? Who is performing that Load Balancing?
Thanks!
it will do load balancing, but its not application aware, so if your pod cannot handle the request due to load the request would be lost or the error would be returned. you can use readyness probes to mark pods as not ready, they will not receive traffic in that case
A piece of Kubernetes infrastructure called kube-proxy
provides load balancing for ClusterIP services (and NodePort and LoadBalancer services when called from inside the cluster). The actual load balancing depends on the cluster configuration but it usually isn't intelligent; typical out-of-the-box setups will use either round-robin or random routing. The section on Virtual IPs and service proxies in the Kubernetes documentation discusses this in a little more detail.
If the pod deployment-a-pod-1
is so busy that it can't handle requests, a third of requests to service-a
will time out. If this backlog also affects the HTTP requests you're using for liveness probes, it will eventually cause the pod to restart, and any outstanding connections to that specific pod will get lost. In both cases the client will have to retry the affected requests.