The documentation here describes how to setup a http(s) utilisation based load balancer with kubernetes on google cloud platform.

The question is how it actually manages to do utilisation based load balancing. For example, with the following configuration:

  • 10 node instance group
  • 3 pod replication controller deployed to that instance group
  • a NodePort service that exposes port X on every node in the instance group.

Assuming the LB will choose the least utilised of the 10 nodes, and route to it on port X, how is a pod chosen to service the request? Does the kubernetes service then select the pod based on some other balancing algorithm?

Clearly something interesting is happening, because most instances will not have a pod running (and therefore might be more likely to be least utilised).

  • It seems that the community around the google-container-engine and kubernetes is on stackoverflow. I suggest you try it there. – tback Feb 25 '16 at 11:03

As describe in this article:

GCE/AWS load balancers do not provide weights for their target pools. This was not an issue with the old LB kube-proxy rules which would correctly balance across all endpoints.

With the new functionality, the external traffic will not be equally load balanced across pods, but rather equally balanced at the node level (because GCE/AWS and other external LB implementations do not have the ability for specifying the weight per node, they balance equally across all target nodes, disregarding the number of pods on each node).

We can, however, state that for NumServicePods « NumNodes or NumServicePods » NumNodes, a fairly close-to-equal distribution will be seen, even without weights.

Once the external load balancers provide weights, this functionality can be added to the LB programming path. Future Work: No support for weights is provided for the 1.4 release, but may be added at a future date

Internal pod to pod traffic should behave similar to ClusterIP services, with equal probability across all pods.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.