api

package
v1.34.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BucketCount = 20 // Must be > 0

)

Variables

This section is empty.

Functions

func NewStringsMap

func NewStringsMap(source map[string]string) map[string]string

func NewTaints

func NewTaints(source []v1.Taint) []v1.Taint

func ResourceNames

func ResourceNames() []v1.ResourceName

Types

type ClusterInfo

type ClusterInfo struct {
	Nodes []*NodeInfo
}

ClusterInfo is a snapshot of cluster by cache.

type CompareFn

type CompareFn func(interface{}, interface{}) int

CompareFn is the func declaration used by sort or priority queue.

type LessFn

type LessFn func(interface{}, interface{}) bool

LessFn is the func declaration used by sort or priority queue.

type NodeInfo

type NodeInfo struct {
	Name string
	Node *v1.Node

	// The releasing resource on that node
	Releasing *Resource

	// The idle resource on that node
	Idle *Resource

	// The used resource on that node, including running and terminating
	// pods
	Used *Resource

	Allocatable *Resource
	Capability  *Resource

	// Track labels for potential filtering
	Labels map[string]string

	// Track Schedulable flag for potential filtering
	Unschedulable bool

	// Taints for potential filtering
	Taints []v1.Taint
}

NodeInfo is node level aggregated information.

func NewNodeInfo

func NewNodeInfo(node *v1.Node) *NodeInfo

func (*NodeInfo) Clone

func (ni *NodeInfo) Clone() *NodeInfo

func (*NodeInfo) SetNode

func (ni *NodeInfo) SetNode(node *v1.Node)

func (NodeInfo) String

func (ni NodeInfo) String() string

type Resource

type Resource struct {
	MilliCPU float64
	Memory   float64
	GPU      int64
}

func EmptyResource

func EmptyResource() *Resource

func NewResource

func NewResource(rl v1.ResourceList) *Resource

func (*Resource) Add

func (r *Resource) Add(rr *Resource) *Resource

func (*Resource) Clone

func (r *Resource) Clone() *Resource

func (*Resource) Get

func (r *Resource) Get(rn v1.ResourceName) (float64, error)

func (*Resource) IsEmpty

func (r *Resource) IsEmpty() bool

func (*Resource) IsZero

func (r *Resource) IsZero(rn v1.ResourceName) (bool, error)

func (*Resource) Less

func (r *Resource) Less(rr *Resource) bool

func (*Resource) LessEqual

func (r *Resource) LessEqual(rr *Resource) bool

func (*Resource) NonNegSub

func (r *Resource) NonNegSub(rr *Resource) (*Resource, error)

Sub subtracts two Resource objects and return zero for negative subtractions.

func (*Resource) Replace

func (r *Resource) Replace(rr *Resource) *Resource

func (*Resource) String

func (r *Resource) String() string

func (*Resource) Sub

func (r *Resource) Sub(rr *Resource) (*Resource, error)

Sub subtracts two Resource objects.

type ResourceHistogram

type ResourceHistogram struct {
	MilliCPU *prometheus.Histogram
	Memory   *prometheus.Histogram
	GPU      *prometheus.Histogram
}

func NewResourceHistogram

func NewResourceHistogram(min *Resource, max *Resource) *ResourceHistogram

func (*ResourceHistogram) Observer

func (rh *ResourceHistogram) Observer(r *Resource)

type TaskStatus

type TaskStatus int

TaskStatus defines the status of a task/pod.

const (
	// Pending means the task is pending in the apiserver.
	Pending TaskStatus = 1 << iota

	// Allocated means the scheduler assigns a host to it.
	Allocated

	// Pipelined means the scheduler assigns a host to wait for releasing resource.
	Pipelined

	// Binding means the scheduler send Bind request to apiserver.
	Binding

	// Bound means the task/Pod bounds to a host.
	Bound

	// Running means a task is running on the host.
	Running

	// Releasing means a task/pod is deleted.
	Releasing

	// Succeeded means that all containers in the pod have voluntarily terminated
	// with a container exit code of 0, and the system is not going to restart any of these containers.
	Succeeded

	// Failed means that all containers in the pod have terminated, and at least one container has
	// terminated in a failure (exited with a non-zero exit code or was stopped by the system).
	Failed

	// Unknown means the status of task/pod is unknown to the scheduler.
	Unknown
)

func (TaskStatus) String

func (ts TaskStatus) String() string

type ValidateFn

type ValidateFn func(interface{}) bool

ValidateFn is the func declaration used to check object's status.

Jump to

Keyboard shortcuts

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