Documentation ¶
Index ¶
- func QuantityToInt64RoundDown(q resource.Quantity, scale resource.Scale) int64
- func QuantityToInt64RoundUp(q resource.Quantity, scale resource.Scale) int64
- type Node
- func (node *Node) DeepCopyNilKeys() *Node
- func (node *Node) FindMatchingUntoleratedTaint(tolerations ...[]v1.Toleration) (v1.Taint, bool)
- func (node *Node) GetExecutor() string
- func (node *Node) GetId() string
- func (node *Node) GetIndex() uint64
- func (node *Node) GetLabelValue(key string) (string, bool)
- func (node *Node) GetLabels() map[string]string
- func (node *Node) GetName() string
- func (node *Node) GetNodeTypeId() uint64
- func (node *Node) GetPool() string
- func (node *Node) GetTaints() []v1.Taint
- func (node *Node) GetTolerationsForTaints() []v1.Toleration
- func (node *Node) GetTotalResources() ResourceList
- func (node *Node) MatchNodeSelectorTerms(nodeSelector *v1.NodeSelector) (bool, error)
- type NodeType
- func (m *NodeType) FindMatchingUntoleratedTaint(tolerations ...[]v1.Toleration) (v1.Taint, bool)
- func (m *NodeType) GetId() uint64
- func (m *NodeType) GetLabelValue(key string) (string, bool)
- func (m *NodeType) GetLabels() map[string]string
- func (m *NodeType) GetTaints() []v1.Taint
- func (m *NodeType) GetUnsetIndexedLabelValue(key string) (string, bool)
- func (m *NodeType) GetUnsetIndexedLabels() map[string]string
- type Resource
- type ResourceList
- func (rl ResourceList) Add(other ResourceList) ResourceList
- func (rl ResourceList) AllZero() bool
- func (rl ResourceList) Equal(other ResourceList) bool
- func (rl ResourceList) ExceedsAvailable(available ResourceList) (string, k8sResource.Quantity, k8sResource.Quantity, bool)
- func (rl ResourceList) GetByName(name string) (int64, error)
- func (rl ResourceList) GetByNameZeroIfMissing(name string) int64
- func (rl ResourceList) GetResources() []Resource
- func (rl ResourceList) HasNegativeValues() bool
- func (rl ResourceList) IsEmpty() bool
- func (rl ResourceList) Negate() ResourceList
- func (rl ResourceList) String() string
- func (rl ResourceList) Subtract(other ResourceList) ResourceList
- type ResourceListFactory
- func (factory *ResourceListFactory) FromJobResourceListFailOnUnknown(resources map[string]k8sResource.Quantity) (ResourceList, error)
- func (factory *ResourceListFactory) FromJobResourceListIgnoreUnknown(resources map[string]k8sResource.Quantity) ResourceList
- func (factory *ResourceListFactory) FromNodeProto(resources map[string]k8sResource.Quantity) ResourceList
- func (factory *ResourceListFactory) GetScale(resourceTypeName string) (k8sResource.Scale, error)
- func (factory *ResourceListFactory) MakeAllZero() ResourceList
- func (factory *ResourceListFactory) SummaryString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QuantityToInt64RoundDown ¶ added in v0.4.48
Types ¶
type Node ¶
type Node struct { // This field is set when inserting the Node into a NodeDb. Keys [][]byte AllocatableByPriority map[int32]ResourceList AllocatedByQueue map[string]ResourceList AllocatedByJobId map[string]ResourceList EvictedJobRunIds map[string]bool // contains filtered or unexported fields }
Node is a scheduler-internal representation of one Kubernetes node. Its private fields should be immutable! Do not change these!
func CreateNode ¶ added in v0.4.37
func CreateNode( id string, nodeTypeId uint64, index uint64, executor string, name string, pool string, taints []v1.Taint, labels map[string]string, totalResources ResourceList, allocatableByPriority map[int32]ResourceList, allocatedByQueue map[string]ResourceList, allocatedByJobId map[string]ResourceList, evictedJobRunIds map[string]bool, keys [][]byte, ) *Node
func (*Node) DeepCopyNilKeys ¶ added in v0.9.0
func (*Node) FindMatchingUntoleratedTaint ¶ added in v0.4.40
func (*Node) GetExecutor ¶ added in v0.4.37
func (*Node) GetLabelValue ¶ added in v0.4.40
func (*Node) GetNodeTypeId ¶ added in v0.4.37
func (*Node) GetTolerationsForTaints ¶ added in v0.4.40
func (node *Node) GetTolerationsForTaints() []v1.Toleration
func (*Node) GetTotalResources ¶ added in v0.9.0
func (node *Node) GetTotalResources() ResourceList
func (*Node) MatchNodeSelectorTerms ¶ added in v0.4.40
func (node *Node) MatchNodeSelectorTerms(nodeSelector *v1.NodeSelector) (bool, error)
type NodeType ¶ added in v0.9.7
type NodeType struct {
// contains filtered or unexported fields
}
NodeType represents a particular combination of taints and labels. The scheduler groups nodes by node type. When assigning pods to nodes, the scheduler only considers nodes with a NodeType for which the taints and labels match. Its fields should be immutable! Do not change these!
func NewNodeType ¶ added in v0.9.7
func (*NodeType) FindMatchingUntoleratedTaint ¶ added in v0.9.7
func (*NodeType) GetLabelValue ¶ added in v0.9.7
func (*NodeType) GetUnsetIndexedLabelValue ¶ added in v0.9.7
func (*NodeType) GetUnsetIndexedLabels ¶ added in v0.9.7
type Resource ¶ added in v0.6.0
type Resource struct { Name string Value int64 Scale k8sResource.Scale }
type ResourceList ¶ added in v0.4.48
type ResourceList struct {
// contains filtered or unexported fields
}
func (ResourceList) Add ¶ added in v0.6.0
func (rl ResourceList) Add(other ResourceList) ResourceList
func (ResourceList) AllZero ¶ added in v0.6.0
func (rl ResourceList) AllZero() bool
func (ResourceList) Equal ¶ added in v0.6.0
func (rl ResourceList) Equal(other ResourceList) bool
func (ResourceList) ExceedsAvailable ¶ added in v0.6.0
func (rl ResourceList) ExceedsAvailable(available ResourceList) (string, k8sResource.Quantity, k8sResource.Quantity, bool)
ExceedsAvailable - if any resource in this ResourceList is greater than the equivalent resource in param available, this function returns
- the name of the relevant resource
- the amount of the relevant resource in available
- the amount of the relevant resource in this ResourceList
- true
- if no resources in this ResourceList exceed available, the last return value is false. - empty resource lists are considered equivalent to all zero.
func (ResourceList) GetByName ¶ added in v0.4.48
func (rl ResourceList) GetByName(name string) (int64, error)
func (ResourceList) GetByNameZeroIfMissing ¶ added in v0.6.0
func (rl ResourceList) GetByNameZeroIfMissing(name string) int64
func (ResourceList) GetResources ¶ added in v0.6.0
func (rl ResourceList) GetResources() []Resource
func (ResourceList) HasNegativeValues ¶ added in v0.6.0
func (rl ResourceList) HasNegativeValues() bool
func (ResourceList) IsEmpty ¶ added in v0.6.0
func (rl ResourceList) IsEmpty() bool
func (ResourceList) Negate ¶ added in v0.6.0
func (rl ResourceList) Negate() ResourceList
func (ResourceList) String ¶ added in v0.6.0
func (rl ResourceList) String() string
func (ResourceList) Subtract ¶ added in v0.6.0
func (rl ResourceList) Subtract(other ResourceList) ResourceList
type ResourceListFactory ¶ added in v0.4.48
type ResourceListFactory struct {
// contains filtered or unexported fields
}
func MakeResourceListFactory ¶ added in v0.4.48
func MakeResourceListFactory(supportedResourceTypes []configuration.ResourceType) (*ResourceListFactory, error)
func (*ResourceListFactory) FromJobResourceListFailOnUnknown ¶ added in v0.6.0
func (factory *ResourceListFactory) FromJobResourceListFailOnUnknown(resources map[string]k8sResource.Quantity) (ResourceList, error)
Fail on unknown resources, round up.
func (*ResourceListFactory) FromJobResourceListIgnoreUnknown ¶ added in v0.6.0
func (factory *ResourceListFactory) FromJobResourceListIgnoreUnknown(resources map[string]k8sResource.Quantity) ResourceList
Ignore unknown resources, round up.
func (*ResourceListFactory) FromNodeProto ¶ added in v0.4.48
func (factory *ResourceListFactory) FromNodeProto(resources map[string]k8sResource.Quantity) ResourceList
Ignore unknown resources, round down.
func (*ResourceListFactory) GetScale ¶ added in v0.6.0
func (factory *ResourceListFactory) GetScale(resourceTypeName string) (k8sResource.Scale, error)
func (*ResourceListFactory) MakeAllZero ¶ added in v0.6.0
func (factory *ResourceListFactory) MakeAllZero() ResourceList
func (*ResourceListFactory) SummaryString ¶ added in v0.4.48
func (factory *ResourceListFactory) SummaryString() string