kubernetesk8s.io/kubernetes/pkg/cloudprovider/nodecontroller Index | Files

package nodecontroller

import "k8s.io/kubernetes/pkg/cloudprovider/nodecontroller"

Package nodecontroller contains code for syncing cloud instances with minion registry

Index

Variables

var (
	ErrRegistration   = errors.New("unable to register all nodes.")
	ErrQueryIPAddress = errors.New("unable to query IP address.")
	ErrCloudInstance  = errors.New("cloud provider doesn't support instances.")
)

Types

type NodeController

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

func NewNodeController

func NewNodeController(
	cloud cloudprovider.Interface,
	kubeClient client.Interface,
	registerRetryCount int,
	podEvictionTimeout time.Duration,
	podEvictor *PodEvictor,
	nodeMonitorGracePeriod time.Duration,
	nodeStartupGracePeriod time.Duration,
	nodeMonitorPeriod time.Duration,
	clusterCIDR *net.IPNet,
	allocateNodeCIDRs bool) *NodeController

NewNodeController returns a new node controller to sync instances from cloudprovider.

func (*NodeController) Run

func (nc *NodeController) Run(period time.Duration)

Run starts an asynchronous loop that monitors the status of cluster nodes.

type PodEvictor

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

Entity responsible for evicting Pods from inserted Nodes. It uses RateLimiter to avoid evicting everything at once. Note that we rate limit eviction of Nodes not individual Pods.

func NewPodEvictor

func NewPodEvictor(deletingPodsRateLimiter util.RateLimiter) *PodEvictor

Creates new PodEvictor which will use given RateLimiter to oversee eviction.

func (*PodEvictor) AddNodeToEvict

func (pe *PodEvictor) AddNodeToEvict(nodeName string) bool

Adds Node to the Evictor to be processed later. Won't add the same Node second time if it was already added and not removed.

func (*PodEvictor) RemoveNodeToEvict

func (pe *PodEvictor) RemoveNodeToEvict(nodeName string) bool

Removes Node from the Evictor. The Node won't be processed until added again.

func (*PodEvictor) TryEvict

func (pe *PodEvictor) TryEvict(delFunc func(string))

Tries to evict all Pods from previously inserted Nodes. Ends prematurely if RateLimiter forbids any eviction. Each Node is processed only once, as long as it's not Removed, i.e. calling multiple AddNodeToEvict does not result with multiple evictions as long as RemoveNodeToEvict is not called.

type UniqueQueue

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

A FIFO queue which additionally guarantees that any element can be added only once until it is removed.

func (*UniqueQueue) Add

func (q *UniqueQueue) Add(value string) bool

Adds a new value to the queue if it wasn't added before, or was explicitly removed by the Remove call. Returns true if new value was added.

func (*UniqueQueue) Get

func (q *UniqueQueue) Get() (string, bool)

Returns the oldest added value that wasn't returned yet.

func (*UniqueQueue) Remove

func (q *UniqueQueue) Remove(value string) bool

Removes the value from the queue, so Get() call won't return it, and allow subsequent addition of the given value. If the value is not present does nothing and returns false.

Source Files

doc.go nodecontroller.go podevictor.go

Version
v0.19.0
Published
Jun 10, 2015
Platform
js/wasm
Imports
14 packages
Last checked
12 seconds ago

Tools for package owners.