Documentation ¶
Index ¶
- type NodeClaimWrapper
- func (w *NodeClaimWrapper) IsNodeAffinityMatched(node *corev1.Node) bool
- func (w *NodeClaimWrapper) IsNodeMatched(node *corev1.Node) bool
- func (w *NodeClaimWrapper) IsNodeSchedulable(node *corev1.Node) bool
- func (w *NodeClaimWrapper) ListNodesByLabelSelector(nodeLister listv1.NodeLister) ([]*corev1.Node, error)
- type NodeInfo
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 ¶
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.