controller

package
v3.6.25-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2017 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 Allocation

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

func (*Allocation) Next

func (c *Allocation) Next(ns *kapi.Namespace) error

Next processes a changed namespace and tries to allocate a uid range for it. If it is successful, an mcs label corresponding to the relative position of the range is also set.

type AllocationFactory

type AllocationFactory struct {
	UIDAllocator uidallocator.Interface
	MCSAllocator MCSAllocationFunc
	Client       kcoreclient.NamespaceInterface
	// Queue may be a FIFO queue of namespaces. If nil, will be initialized using
	// the client.
	Queue controller.ReQueue
}

AllocationFactory can create an Allocation controller.

func (*AllocationFactory) Create

Create creates a Allocation.

type MCSAllocationFunc

type MCSAllocationFunc func(uid.Block) *mcs.Label

func DefaultMCSAllocation

func DefaultMCSAllocation(from *uid.Range, to *mcs.Range, blockSize int) MCSAllocationFunc

DefaultMCSAllocation returns a label from the MCS range that matches the offset within the overall range. blockSize must be a positive integer representing the number of labels to jump past in the category space (if 1, range == label, if 2 each range will have two labels).

type Repair

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

Repair is a controller loop that periodically examines all UID allocations and logs any errors, and then sets the compacted and accurate list of both

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

func NewRepair

func NewRepair(interval time.Duration, client kcoreclient.NamespaceInterface, uidRange *uid.Range, alloc rangeallocation.RangeRegistry) *Repair

NewRepair creates a controller that periodically ensures that all UIDs labels that are allocated in the cluster are claimed.

func (*Repair) RunOnce

func (c *Repair) RunOnce() error

RunOnce verifies the state of 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