nodes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OnDemandNodeLabel label for on-demand instances.
	OnDemandNodeLabel = "kubernetes.io/role=worker"
	// SpotNodeLabel label for spot instances.
	SpotNodeLabel = "kubernetes.io/role=spot-worker"
	// OnDemand key for on-demand instances of NodesMap.
	OnDemand NodeType
	// Spot key for spot instances of NodesMap.
	Spot NodeType = 1
)

Functions

This section is empty.

Types

type Map

type Map map[NodeType]NodeInfoArray

Map map of NodeInfoArray.

func NewNodeMap

func NewNodeMap(client kube_client.Interface, nodes []*apiv1.Node) (Map, error)

NewNodeMap creates a new NodesMap from a list of Nodes.

type NodeInfo

type NodeInfo struct {
	Node         *apiv1.Node
	Pods         []*apiv1.Pod
	RequestedCPU int64
	FreeCPU      int64
}

NodeInfo struct containing node and it's pods as well information resources on the node.

func (*NodeInfo) AddPod

func (n *NodeInfo) AddPod(pod *apiv1.Pod)

AddPod adds a pod to a NodeInfo and updates the relevant resource values.

type NodeInfoArray

type NodeInfoArray []*NodeInfo

NodeInfoArray array of NodeInfo pointers.

func (NodeInfoArray) CopyNodeInfos

func (n NodeInfoArray) CopyNodeInfos() NodeInfoArray

CopyNodeInfos returns an array of copies of the NodeInfos in this array.

type NodeType

type NodeType int

NodeType integer key for keying NodesMap.

Jump to

Keyboard shortcuts

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