provider

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 15 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ReservedTCPPorts represents the reserved tcp ports
	ReservedTCPPorts = []string{"450", "451"}
	// ReservedUDPPorts represents the reserved udp ports
	ReservedUDPPorts = []string{}
)

Functions

func GetExportedPorts

func GetExportedPorts(lb *lbapi.LoadBalancer, tcpcm, udpcm *v1.ConfigMap) ([]string, []string)

GetExportedPorts get exported ports from tcp and udp ConfigMap

func GetHTTPPort

func GetHTTPPort(lb *lbapi.LoadBalancer) int

func GetHTTPSPort

func GetHTTPSPort(lb *lbapi.LoadBalancer) int

Types

type Configuration

type Configuration struct {
	KubeClient            kubernetes.Interface
	Backend               Provider
	LoadBalancerName      string
	LoadBalancerNamespace string
	TCPConfigMap          string
	UDPConfigMap          string
}

Configuration contains all the settings required by an LoadBalancer controller

type GenericProvider

type GenericProvider struct {
	// contains filtered or unexported fields
}

GenericProvider holds the boilerplate code required to build an LoadBalancer Provider.

func NewLoadBalancerProvider

func NewLoadBalancerProvider(cfg *Configuration) *GenericProvider

NewLoadBalancerProvider returns a configured LoadBalancer controller

func (*GenericProvider) Start

func (p *GenericProvider) Start()

Start starts the LoadBalancer Provider.

func (*GenericProvider) Stop

func (p *GenericProvider) Stop() error

Stop stops the LoadBalancer Provider.

type Info

type Info struct {
	// Name returns the name of the backend implementation
	Name string `json:"name"`
	// Release returns the running version (semver)
	Version string `json:"version"`
	// Build returns information about the git commit
	GitCommit string `json:"gitCommit"`
	// GitRemote return information about the git remote repository
	GitRemote string `json:"gitRemote"`
}

Info returns information about the provider. This fields contains information that helps to track issues or to map the running loadbalancer provider to source code

type Provider

type Provider interface {
	// Info returns information about the loadbalancer provider
	Info() Info
	// SetListers allows the access of store listers present in the generic controller
	// This avoid the use of the kubernetes client.
	SetListers(StoreLister)
	// OnUpdate callback invoked when loadbalancer changed
	OnUpdate(*lbapi.LoadBalancer) error
	// Start starts the loadbalancer provider
	Start()
	// WaitForStart waits for provider fully run
	WaitForStart() bool
	// Stop shuts down the loadbalancer provider
	Stop() error
}

Provider holds the methods to handle an Provider backend

type StoreLister

type StoreLister struct {
	KubeClient   kubernetes.Interface
	LoadBalancer lblisters.LoadBalancerLister
	Node         v1listers.NodeLister
	ConfigMap    v1listers.ConfigMapLister
	Secret       v1listers.SecretLister
	Machine      v1beta1.MachineLister
}

StoreLister returns the configured store for loadbalancers, nodes

Jump to

Keyboard shortcuts

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