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

package controller

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

Package controller 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,
	matchRE string,
	nodes []string,
	staticResources *api.NodeResources,
	kubeClient client.Interface,
	kubeletClient client.KubeletClient,
	recorder record.EventRecorder,
	registerRetryCount int,
	podEvictionTimeout time.Duration) *NodeController

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

func (*NodeController) DoCheck

func (nc *NodeController) DoCheck(node *api.Node) []api.NodeCondition

DoCheck performs various condition checks for given node.

func (*NodeController) GetCloudNodesWithSpec

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

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

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

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

PopulateAddresses queries Address for given list of nodes.

func (*NodeController) PopulateNodesStatus

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

PopulateNodesStatus populates node status for given list of nodes.

func (*NodeController) RegisterNodes

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

func (nc *NodeController) Run(period time.Duration, syncNodeList, syncNodeStatus 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. Depending on how k8s is configured, there are two ways of syncing the node status: 3.1 SyncProbedNodeStatus() is called periodically to trigger master to probe kubelet, and incorporate the resulting node status. 3.2 MonitorNodeStatus() is called periodically to incorporate the results of node status pushed from kubelet to master.

func (*NodeController) SyncCloudNodes

func (nc *NodeController) SyncCloudNodes() error

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

func (*NodeController) SyncProbedNodeStatus

func (nc *NodeController) SyncProbedNodeStatus() error

SyncProbedNodeStatus synchronizes cluster nodes status to master server.

Source Files

doc.go nodecontroller.go

Version
v0.14.0
Published
Mar 30, 2015
Platform
js/wasm
Imports
16 packages
Last checked
34 seconds ago

Tools for package owners.