controller

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repair

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

Repair is a controller loop that periodically examines all service PortalIP allocations and logs any errors, and then sets the compacted and accurate list of all allocated IPs.

Handles: * Duplicate PortalIP assignments caused by operator action or undetected race conditions * PortalIPs that do not match the current portal network * Allocations to services that were not actually created due to a crash or powerloss * Migrates old versions of Kubernetes services into the atomic ipallocator model automatically

Can be run at infrequent intervals, and is best performed on startup of the master. Is level driven and idempotent - all valid PortalIPs will be updated into the ipallocator map at the end of a single execution loop if no race is encountered.

TODO: allocate new IPs if necessary TODO: perform repair?

func NewRepair

func NewRepair(interval time.Duration, registry service.Registry, network *net.IPNet, alloc service.IPRegistry) *Repair

NewRepair creates a controller that periodically ensures that all portalIPs are uniquely allocated across the cluster and generates informational warnings for a cluster that is not in sync.

func (*Repair) RunOnce

func (c *Repair) RunOnce() error

RunOnce verifies the state of the portal IP allocations and returns an error if an unrecoverable problem occurs.

func (*Repair) RunUntil

func (c *Repair) RunUntil(ch chan struct{})

RunUntil starts the controller until the provided ch is closed.

Jump to

Keyboard shortcuts

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