Documentation
¶
Index ¶
Constants ¶
View Source
const (
// CustomHostAnnotation is annotation which enables lb for custom route hostname
CustomHostAnnotation = "route.elisa.fi/lbenabled"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func RegisterProvider(name string, cloud ProviderInterface)
RegisterProvider registers new load balancer provider
Types ¶
type ProviderInterface ¶
type ProviderInterface interface {
// Initialize initilizes new provider
Initialize()
// creates new loadbalancer pool
CreatePool(name string, port string) error
// adds new member to pool
AddPoolMember(membername string, name string, port string) error
// modifies loadbalancer pool
ModifyPool(name string, port string, loadBalancingMethod string, pga int, maintenance bool, prio int, role string) error
// creates new monitor
CreateMonitor(host string, port string, uri string, httpMethod string, interval int, timeout int) error
// modifies monitor
ModifyMonitor(host string, port string, uri string, httpMethod string, interval int, timeout int) error
// adds monitor to pool
AddMonitorToPool(name string, port string) error
// delete pool member
DeletePoolMember(membername string, name string, port string) error
// checks pool members and if 0 members left in pool, delete monitor and delete pool
CheckAndClean(name string, port string)
// executed before something is updated. Can be used for instance to checking active member of the HA lb
PreUpdate()
// executed after something is updated. Can be used for instance to configuration sync
PostUpdate()
// returns hosts which should be removed
CheckPools(routes []v1.Route, hosttowatch string, membername string) map[string]bool
// testing purposes
Calls() []string
CleanCalls()
}
ProviderInterface is an abstract, pluggable interface for different loadbalancers.
type RouteController ¶
type RouteController struct {
// contains filtered or unexported fields
}
RouteController watches the kubernetes api for changes to routes
func NewRouteController ¶
func NewRouteController(kclient *kubernetes.Clientset, config *restclient.Config) *RouteController
NewRouteController creates a new RouteController
func (*RouteController) InitProvider ¶
func (c *RouteController) InitProvider() ProviderInterface
InitProvider returns load balancer providerinterface
func (*RouteController) Run ¶
func (c *RouteController) Run(stopCh <-chan struct{}, wg *sync.WaitGroup)
Run starts the process for listening for route changes and acting upon those changes.
Click to show internal directories.
Click to hide internal directories.