I was checking UpdateLoadBalancer implementation in kubernetes. Following is my understanding:
Setup – 3 nodes – 1 Master and 2 Minions
- Create a service with type=LoadBalancer, without any pods associated to it.
- Create 1 pod(pod-1 lands in minion-1) for the service – UpdateLoadBalancer is invoked.
- Scale the pods for the service to 2.
- Pod-2 lands in minion-2 - UpdateLoadBalancer is invoked.
- Scale the pods to 3. Pod-3 lands in minion-1 or minion-2 - UpdateLoadBalancer is not invoked.
The reason is, UpdateLoadBalancer is only called if a new minion/node is associated with a service. Since minion-1 and minion-2 are already associated with the service, update is not invoked.
I am writing a cloud provider plugin for kubernetes. Currently all the cloud providers have added minion nodes as members for load balancer. But in my implementation I have added the pod’s IP as members of the LB.