fipcontroller

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	HetznerClient    *hcloud.Client
	KubernetesClient kubernetes.Interface
	Configuration    *configuration.Configuration
	Logger           *logrus.Logger
	Backoff          wait.Backoff
}

Controller is the main struct used for all other functions in this package. Holds all client configurations and loggers

func NewController

func NewController(config *configuration.Configuration) (*Controller, error)

NewController creates a new Controller and with it the client configurations and loggers

func (*Controller) Run

func (controller *Controller) Run(ctx context.Context) error

Run updates Floating IPs once initially and every 30s afterwards

=== Main Thread ===

func (*Controller) RunWithLeaderElection

func (controller *Controller) RunWithLeaderElection(ctx context.Context)

RunWithLeaderElection starts a leaderelection and will run the main logic when it becomes the leader

func (*Controller) UpdateFloatingIPs

func (controller *Controller) UpdateFloatingIPs(ctx context.Context) error

UpdateFloatingIPs searches for running hetzner cloud servers and sort them by fewest assigned floating ips. It then (re)assigns all unassigned ips or ips that are assigned to non running servers to the sorted running serves.

Jump to

Keyboard shortcuts

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