nodes

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeClaimWrapper added in v1.2.0

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

NodeClaimWrapper is a wrapper that wraps the node claim.

func NewNodeClaimWrapper added in v1.2.0

func NewNodeClaimWrapper(claim *pb.NodeClaim) (*NodeClaimWrapper, error)

NewNodeClaimWrapper returns a new NodeClaimWrapper.

func (*NodeClaimWrapper) IsNodeAffinityMatched added in v1.2.0

func (w *NodeClaimWrapper) IsNodeAffinityMatched(node *corev1.Node) bool

IsNodeAffinityMatched returns whether the node matches the node affinity.

func (*NodeClaimWrapper) IsNodeMatched added in v1.2.0

func (w *NodeClaimWrapper) IsNodeMatched(node *corev1.Node) bool

IsNodeMatched returns whether the node matches all conditions.

func (*NodeClaimWrapper) IsNodeSchedulable added in v1.2.0

func (w *NodeClaimWrapper) IsNodeSchedulable(node *corev1.Node) bool

IsNodeSchedulable returns whether the node matches the tolerations.

func (*NodeClaimWrapper) ListNodesByLabelSelector added in v1.2.0

func (w *NodeClaimWrapper) ListNodesByLabelSelector(nodeLister listv1.NodeLister) ([]*corev1.Node, error)

ListNodesByLabelSelector returns nodes that match the node selector.

type NodeInfo

type NodeInfo struct {
	Node *corev1.Node

	AllocatableResource *util.Resource
	IdleResource        *util.Resource
}

NodeInfo is the wrapper of a node and its resource.

func NewNodeInfo

func NewNodeInfo(node *corev1.Node) *NodeInfo

NewNodeInfo returns an instance of NodeInfo. The initial IdleResource equals with AllocatableResource.

func (*NodeInfo) AssignedPodRequest

func (ni *NodeInfo) AssignedPodRequest(pods []*corev1.Pod) error

AssignedPodRequest counts the effective request resource of pods for the node. IdleResource will be subtracted from the all pod request resources when this function is called.

func (*NodeInfo) MaxReplicaDivided

func (ni *NodeInfo) MaxReplicaDivided(rl corev1.ResourceList) int64

MaxReplicaDivided returns how many replicas that the node can produce.

Jump to

Keyboard shortcuts

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