Documentation ¶
Index ¶
- type NodeGroupResources
- type NodeGroupSchedulingMetadata
- type NodeSchedulingMetadata
- type Resources
- func (r *Resources) Add(other *Resources)
- func (r *Resources) AddFromReservation(reservation *v1beta1.Reservation)
- func (r *Resources) AddFromResourceList(resourceList corev1.ResourceList)
- func (r *Resources) Copy() *Resources
- func (r *Resources) Eq(other *Resources) bool
- func (r *Resources) GreaterThan(other *Resources) bool
- func (r *Resources) SetMaxResource(resourceList corev1.ResourceList)
- func (r *Resources) Sub(other *Resources)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeGroupResources ¶
NodeGroupResources represents resources for a group of nodes
func AvailableForNodes ¶
func AvailableForNodes(nodes []*corev1.Node, currentUsage NodeGroupResources) NodeGroupResources
AvailableForNodes finds available resources by subtracting current usage from allocatable per node
func UsageForNodes ¶
func UsageForNodes(resourceReservations []*v1beta1.ResourceReservation) NodeGroupResources
UsageForNodes tallies resource usages per node from the given list of resource reservations
func (NodeGroupResources) Add ¶
func (nodeResources NodeGroupResources) Add(other NodeGroupResources)
Add adds all resources in other into the receiver, modifies receiver
func (NodeGroupResources) Sub ¶
func (nodeResources NodeGroupResources) Sub(other NodeGroupResources)
Sub subtract all resources in other from the receiver, modifies receiver
type NodeGroupSchedulingMetadata ¶
type NodeGroupSchedulingMetadata map[string]*NodeSchedulingMetadata
NodeGroupSchedulingMetadata represents NodeSchedulingMetadata for a group of nodes
func NodeSchedulingMetadataForNodes ¶
func NodeSchedulingMetadataForNodes(nodes []*corev1.Node, currentUsage NodeGroupResources) NodeGroupSchedulingMetadata
NodeSchedulingMetadataForNodes calculate available resources by subtracting current usage from allocatable per node
func (NodeGroupSchedulingMetadata) SubtractUsageIfExists ¶
func (nodesSchedulingMetadata NodeGroupSchedulingMetadata) SubtractUsageIfExists(usedResourcesByNodeName NodeGroupResources)
SubtractUsageIfExists subtracts usedResourcesByNodeName from the receiver, modifies receiver, only for nodes that exist in receiver
type NodeSchedulingMetadata ¶
type NodeSchedulingMetadata struct { AvailableResources *Resources CreationTimestamp time.Time ZoneLabel string AllLabels map[string]string Unschedulable bool Ready bool }
NodeSchedulingMetadata represents various parameters of a node that are considered in scheduling decisions
type Resources ¶
Resources represents the CPU and Memory resource quantities
func (*Resources) AddFromReservation ¶
func (r *Resources) AddFromReservation(reservation *v1beta1.Reservation)
AddFromReservation modifies the receiver in place.
func (*Resources) AddFromResourceList ¶
func (r *Resources) AddFromResourceList(resourceList corev1.ResourceList)
AddFromResourceList modified the receiver in place
func (*Resources) Eq ¶
Eq returns true if both CPU and Memory quantities are equal between this Resources object and other
func (*Resources) GreaterThan ¶
GreaterThan returns true if either the CPU or Memory quantities of this object are greater than those of other
func (*Resources) SetMaxResource ¶ added in v0.2.9
func (r *Resources) SetMaxResource(resourceList corev1.ResourceList)
SetMaxResource modifies the receiver in place to set each resource to the greater value of itself or the corresponding resource in resourceList