Documentation ¶
Index ¶
- func CalicoTunnelAddress(node v1.Node) (string, error)
- type AddressPool
- type LoadBalancerController
- func (l *LoadBalancerController) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (l *LoadBalancerController) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
- func (l *LoadBalancerController) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)
- func (l *LoadBalancerController) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
- func (l *LoadBalancerController) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error
- func (l *LoadBalancerController) UpdateMetalLBConfig(nodes []v1.Node) error
- type MatchExpression
- type MetalLBConfig
- type NodeSelector
- type Peer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddressPool ¶
type AddressPool struct { Name string `json:"name" yaml:"name"` Protocol string `json:"protocol" yaml:"protocol"` AutoAssign *bool `json:"auto-assign" yaml:"auto-assign,omitempty"` CIDRs []string `json:"addresses,omitempty" yaml:"addresses,omitempty"` // It is assumed that only /32 addresses are used. }
func NewBGPAddressPool ¶
func NewBGPAddressPool(name string, autoAssign bool) *AddressPool
func (*AddressPool) AppendIP ¶
func (pool *AddressPool) AppendIP(ip string)
func (*AddressPool) ContainsCIDR ¶
func (pool *AddressPool) ContainsCIDR(cidr string) bool
func (*AddressPool) String ¶
func (pool *AddressPool) String() string
type LoadBalancerController ¶
type LoadBalancerController struct { K8sClient clientset.Interface // contains filtered or unexported fields }
func New ¶
func New(client *metalgo.Driver, partitionID, projectID, clusterID, defaultExternalNetworkID string) *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) UpdateMetalLBConfig ¶
func (l *LoadBalancerController) UpdateMetalLBConfig(nodes []v1.Node) error
UpdateMetalLBConfig the metallb config for given nodes
type MatchExpression ¶
type MetalLBConfig ¶
type MetalLBConfig struct { Peers []*Peer `json:"peers,omitempty" yaml:"peers,omitempty"` AddressPools []*AddressPool `json:"address-pools,omitempty" yaml:"address-pools,omitempty"` // contains filtered or unexported fields }
MetalLBConfig is a struct containing a config for metallb
func (*MetalLBConfig) CalculateConfig ¶
func (cfg *MetalLBConfig) CalculateConfig(ips []*models.V1IPResponse, nws map[string]*models.V1NetworkResponse, nodes []v1.Node) error
CalculateConfig computes the metallb config from given parameter input.
func (*MetalLBConfig) ToYAML ¶
func (cfg *MetalLBConfig) ToYAML() (string, error)
ToYAML returns this config in YAML format.
type NodeSelector ¶
type NodeSelector struct {
MatchExpressions []*MatchExpression `json:"match-expressions,omitempty" yaml:"match-expressions,omitempty"`
}