lighthouse.balancer

class lighthouse.balancer.Balancer[source]

Bases: lighthouse.pluggable.Pluggable

Base class for load balancer definitions.

The complexity of generating valid configuration content and updating the proper file(s) is left as details for subclasses so this base class remains incredibly simple.

All subclasses are expected to implement a sync_file method that is called whenever an update to the topography of nodes happens.

config_subdirectory = 'balancers'
entry_point = 'lighthouse.balancers'
sync_file(clusters)[source]

This method must take a list of clusters and update any and all relevant configuration files with valid config content for balancing requests for the given clusters.