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.
Click to show internal directories.
Click to hide internal directories.