kubernetes: k8s.io/kubernetes/pkg/registry/core/service/ipallocator/controller Index | Files

package controller

import "k8s.io/kubernetes/pkg/registry/core/service/ipallocator/controller"


Package Files


type Repair Uses

type Repair struct {
    // contains filtered or unexported fields

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

Handles: * Duplicate ClusterIP assignments caused by operator action or undetected race conditions * ClusterIPs that do not match the currently configured range * 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 ClusterIPs 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 Uses

func NewRepair(interval time.Duration, serviceClient corev1client.ServicesGetter, eventClient corev1client.EventsGetter, network *net.IPNet, alloc rangeallocation.RangeRegistry, secondaryNetwork *net.IPNet, secondaryAlloc rangeallocation.RangeRegistry) *Repair

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

func (*Repair) RunOnce Uses

func (c *Repair) RunOnce() error

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

func (*Repair) RunUntil Uses

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

RunUntil starts the controller until the provided ch is closed.

Package controller imports 19 packages (graph) and is imported by 1 packages. Updated 2019-09-18. Refresh now. Tools for package owners.