Documentation ¶
Index ¶
- func FilterNodesByNodeAffinity(nodes []*corev1.Node, affinity *corev1.NodeSelector) ([]*corev1.Node, error)
- func FilterSchedulableNodes(nodes []*corev1.Node, tolerations []corev1.Toleration) ([]*corev1.Node, error)
- func ListAllNodes(nodeLister listv1.NodeLister) ([]*corev1.Node, error)
- func ListNodesByLabelSelector(nodeLister listv1.NodeLister, selector labels.Selector) ([]*corev1.Node, error)
- func ListNodesByNodeClaim(nodeLister listv1.NodeLister, claim *pb.NodeClaim) ([]*corev1.Node, error)
- type NodeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterNodesByNodeAffinity ¶
func FilterNodesByNodeAffinity(nodes []*corev1.Node, affinity *corev1.NodeSelector) ([]*corev1.Node, error)
FilterNodesByNodeAffinity returns nodes that match the node affinity.
func FilterSchedulableNodes ¶
func FilterSchedulableNodes(nodes []*corev1.Node, tolerations []corev1.Toleration) ([]*corev1.Node, error)
FilterSchedulableNodes filters schedulable nodes that match the given tolerations.
func ListAllNodes ¶
func ListAllNodes(nodeLister listv1.NodeLister) ([]*corev1.Node, error)
ListAllNodes returns all nodes.
func ListNodesByLabelSelector ¶
func ListNodesByLabelSelector(nodeLister listv1.NodeLister, selector labels.Selector) ([]*corev1.Node, error)
ListNodesByLabelSelector returns nodes that match the node selector.
func ListNodesByNodeClaim ¶
func ListNodesByNodeClaim(nodeLister listv1.NodeLister, claim *pb.NodeClaim) ([]*corev1.Node, error)
ListNodesByNodeClaim returns all nodes that match the node claim.
Types ¶
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 ¶
NewNodeInfo returns an instance of NodeInfo. The initial IdleResource equals with AllocatableResource.
func (*NodeInfo) AssignedPodRequest ¶
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.