Documentation ¶
Overview ¶
Package controller implements logic for following MetalLB announce events and passing them to configured platform-specific Floating IP assigners.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assigner ¶
type Assigner interface {
EnsureAssigned(ctx context.Context, nodeAnnouncingByIP map[string]string) error
}
Assigner describes an interface which must be implemented by cloud platform specific implementation to assign Floating IP addresses to cluster nodes.
type Klogger ¶
type Klogger struct{}
Klogger is a default Logger interface implementation using klog.
func (Klogger) Debugf ¶
Debugf implements Logger interface using klog.Infof with log level defined by klogLevelDebug constant.
type Logger ¶
type Logger interface { // Logger should implement writer interface for writing debug logs. io.Writer // Errorf should be used for logging non-critical (operational) failures. Errorf(format string, a ...interface{}) // Infof should be used to log details about activity happening. Infof(format string, a ...interface{}) // Debugf should be used to log as much details as possible. Debugf(format string, a ...interface{}) }
Logger is an logging interface used by this controller. Default implementation is provided by Klogger struct, however other implementations can be configured and used.
type MetalLBHCloudControllerConfig ¶
type MetalLBHCloudControllerConfig struct { // Path to kubeconfig file to use. If empty, either in-cluster kubeconfig file will // be used or will fallback to use ~/.kube/config file. KubeconfigPath string // Logger implementation to use. If omitted, Klogger will be used. Logger Logger // Map of assigner implementations, where alternative assigner implementations can // be added. Assigners map[string]Assigner // Channel on which controller will look for shutdown signal. If nil, channel will be // initialized and it is up to the caller to close it. StopCh <-chan struct{} // Optional Prometheus Registerer to register controller metrics. PrometheusRegistrer prometheus.Registerer }
MetalLBHCloudControllerConfig is used to configure and run MetalLB Hetzner Cloud controller.
func (MetalLBHCloudControllerConfig) New ¶
func (cc MetalLBHCloudControllerConfig) New() (*metalLBHCloudController, error)
New Validates controller configuration and starts the controller.