kubernetes.v0: gopkg.in/kubernetes/kubernetes.v0/pkg/cloudprovider/nodecontroller Index | Files

package nodecontroller

import "gopkg.in/kubernetes/kubernetes.v0/pkg/cloudprovider/nodecontroller"

Package nodecontroller contains code for syncing cloud instances with minion registry

Index

Package Files

doc.go nodecontroller.go podevictor.go

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.")
)

type NodeController Uses

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

func NewNodeController Uses

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 Uses

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

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

type PodEvictor Uses

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 Uses

func NewPodEvictor(deletingPodsRateLimiter util.RateLimiter) *PodEvictor

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

func (*PodEvictor) AddNodeToEvict Uses

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 Uses

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

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

func (*PodEvictor) TryEvict Uses

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 Uses

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 Uses

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 Uses

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

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

func (*UniqueQueue) Remove Uses

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.

Package nodecontroller imports 14 packages (graph). Updated 2016-07-25. Refresh now. Tools for package owners.