loadbalancer

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadBalancerController

type LoadBalancerController struct {
	MetalService *metal.MetalService

	K8sClientSet clientset.Interface
	K8sClient    client.Client
	// contains filtered or unexported fields
}

func New

func New(partitionID, projectID, clusterID, defaultExternalNetworkID string, additionalNetworks []string, loadBalancerType config.LoadBalancerType) *LoadBalancerController

New returns a new load balancer controller that satisfies the kubernetes cloud provider load balancer interface

func (*LoadBalancerController) EnsureLoadBalancer

func (l *LoadBalancerController) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

EnsureLoadBalancer ensures that the cluster is running a load balancer for service. It creates a new load balancer or updates the existing one. Returns the status of the balancer. Neither 'service' nor 'nodes' are modified. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager.

func (*LoadBalancerController) EnsureLoadBalancerDeleted

func (l *LoadBalancerController) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error

EnsureLoadBalancerDeleted deletes the cluster load balancer if it exists, returning nil if the load balancer specified either didn't exist or was successfully deleted. This construction is useful because many cloud providers' load balancers have multiple underlying components, meaning a Get could say that the LB doesn't exist even if some part of it is still laying around. Parameter 'service' is not modified. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager

func (*LoadBalancerController) GetLoadBalancer

func (l *LoadBalancerController) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)

GetLoadBalancer returns whether the specified load balancer exists, and if so, what its status is. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager.

func (*LoadBalancerController) GetLoadBalancerName

func (l *LoadBalancerController) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string

GetLoadBalancerName returns the name of the load balancer.

func (*LoadBalancerController) UpdateLoadBalancer

func (l *LoadBalancerController) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error

UpdateLoadBalancer updates hosts under the specified load balancer. Neither 'service' nor 'nodes' are modified. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager.

func (*LoadBalancerController) UpdateLoadBalancerConfig added in v0.9.2

func (l *LoadBalancerController) UpdateLoadBalancerConfig(ctx context.Context, nodes []v1.Node) error

UpdateLoadBalancerConfig updates the load balancer config for the given nodes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL