openwhisk icon indicating copy to clipboard operation
openwhisk copied to clipboard

Merge LoadBalancer into Controller

Open perryibm opened this issue 10 years ago • 4 comments

The work currently performed by the load balancer is currently too small to justify being standalone. The extra layer also creates extra communication in terms of distinct paths and transmission time. We want to merge the load balancer functionality into the controller which should be fairly easy as the communication pattern is already synchronous via a REST call. At the same time, the controller which once performed very little work has becomes significant (and even more with load balancer addition) and should be moved to master (from edge). This can be done in 2 steps:

  1. Move controller from edge to master. This should be fairly easy and involve configuration file changes only. Doing this as a separate step mitigates risk by first testing if there is some unforeseen network/firewall aspect we did not anticipate.
  2. With controller and load balancer on the same VM, change the interface from a REST call to a function call by deploying all logic in the same container. Some things to do: a. External references to the load balancer have to be adjusted to the controller b. Make sure there is no API clash c. Consolidate global aspects like consul and health reporting to avoid duplicate/overlap

perryibm avatar Mar 30 '16 16:03 perryibm

@perryibm pls also consider the ansible runbooks and get in touch with @domdom82

see pull request #163

jeremiaswerner avatar Apr 04 '16 07:04 jeremiaswerner

Will do. The current PR is not actually merging yet so nothing to be done wrt ansible.

@domdom82 In an earlier PR, I had moved the controller from edge to master. I updated a controller.yam file as Hoang agreed that it would be ok. The current PR isn't moving anything so it doesn't matter. The next step (work about to start on this) will the the final merge. Does it suffice to simply disable the deployment of the load balancer?

perryibm avatar Apr 04 '16 14:04 perryibm

Everything except rules is working because the activator needs to talk to the load balancer which no longer exists. ~~One alternative is to add these routes back to the controller but this seems a bit silly as we are about to get rid of the activator. Since this is going reasonably fast, Rodric and I think we can just expand this work item to include merging the activator in as well.~~

Update So of the 3 alternatives, we are going with the third one.

  1. Just run a separate load balancer. This was falsely attractive in that it worked right out of the box - discovered by accident. The load balancer's DoS and who knows what else is not able to deal with this scenario so let's not accidentally scale the load balancer.
  2. Integrate activator into controller now. The activator needs significant rework and also does complicated things like dynamically update topics. Seems too involved to move it at this point.
  3. Add route to the controller to handle existing activator -> loadbalancer. Just add a new route (inaccessible to user) to the controller that allows the activator to talk to the internal loadbalancer.

perryibm avatar Apr 06 '16 01:04 perryibm

Option 3 from above was implemented successfully. The code has been successfully merged.

There was a final tweak to fix the fact that there was a load balancer hot swap test that started an errant load balancer. Removal of this test closes the loop.

perryibm avatar Apr 08 '16 16:04 perryibm