controller

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package controller contains code for syncing cloud instances with minion registry

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type NodeController added in v0.9.0

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

func NewNodeController added in v0.9.0

func NewNodeController(
	cloud cloudprovider.Interface,
	matchRE string,
	nodes []string,
	staticResources *api.NodeResources,
	kubeClient client.Interface,
	kubeletClient client.KubeletClient,
	registerRetryCount int,
	podEvictionTimeout time.Duration,
	deletingPodsRateLimiter util.RateLimiter,
	nodeMonitorGracePeriod time.Duration,
	nodeStartupGracePeriod time.Duration,
	nodeMonitorPeriod time.Duration,
	clusterName string) *NodeController

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

func (*NodeController) GetCloudNodesWithSpec added in v0.13.0

func (nc *NodeController) GetCloudNodesWithSpec() (*api.NodeList, error)

GetCloudNodesWithSpec constructs and returns api.NodeList from cloudprovider. If error occurs, an empty NodeList will be returned with a non-nil error info. The method only constructs spec fields for nodes.

func (*NodeController) GetStaticNodesWithSpec added in v0.13.0

func (nc *NodeController) GetStaticNodesWithSpec() (*api.NodeList, error)

GetStaticNodesWithSpec constructs and returns api.NodeList for static nodes. If error occurs, an empty NodeList will be returned with a non-nil error info. The method only constructs spec fields for nodes.

func (*NodeController) MonitorNodeStatus added in v0.14.0

func (nc *NodeController) MonitorNodeStatus() error

MonitorNodeStatus verifies node status are constantly updated by kubelet, and if not, post "NodeReady==ConditionUnknown". It also evicts all pods if node is not ready or not reachable for a long period of time.

func (*NodeController) PopulateAddresses added in v0.13.0

func (nc *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList, error)

PopulateAddresses queries Address for given list of nodes.

func (*NodeController) RegisterNodes added in v0.10.0

func (nc *NodeController) RegisterNodes(nodes *api.NodeList, retryCount int, retryInterval time.Duration) error

RegisterNodes registers the given list of nodes, it keeps retrying for `retryCount` times.

func (*NodeController) Run added in v0.9.0

func (nc *NodeController) Run(period time.Duration, syncNodeList bool)

Run creates initial node list and start syncing instances from cloudprovider, if any. It also starts syncing or monitoring cluster node status.

  1. RegisterNodes() is called only once to register all initial nodes (from cloudprovider or from command line flag). To make cluster bootstrap faster, node controller populates node addresses.
  2. SyncCloudNodes() is called periodically (if enabled) to sync instances from cloudprovider. Node created here will only have specs.
  3. MonitorNodeStatus() is called periodically to incorporate the results of node status pushed from kubelet to master.

func (*NodeController) SyncCloudNodes added in v0.14.0

func (nc *NodeController) SyncCloudNodes() error

SyncCloudNodes synchronizes the list of instances from cloudprovider to master server.

type NodeStatusData added in v0.15.0

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

Jump to

Keyboard shortcuts

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