Documentation ¶
Index ¶
- Constants
- func NewStringsMap(source map[string]string) map[string]string
- func NewTaints(source []v1.Taint) []v1.Taint
- func ResourceNames() []v1.ResourceName
- type ClusterInfo
- type CompareFn
- type LessFn
- type NodeInfo
- type Resource
- func (r *Resource) Add(rr *Resource) *Resource
- func (r *Resource) Clone() *Resource
- func (r *Resource) Get(rn v1.ResourceName) (float64, error)
- func (r *Resource) IsEmpty() bool
- func (r *Resource) IsZero(rn v1.ResourceName) (bool, error)
- func (r *Resource) Less(rr *Resource) bool
- func (r *Resource) LessEqual(rr *Resource) bool
- func (r *Resource) NonNegSub(rr *Resource) (*Resource, error)
- func (r *Resource) Replace(rr *Resource) *Resource
- func (r *Resource) String() string
- func (r *Resource) Sub(rr *Resource) (*Resource, error)
- type ResourceHistogram
- type TaskStatus
- type ValidateFn
Constants ¶
View Source
const (
BucketCount = 20 // Must be > 0
)
View Source
const (
// need to follow https://github.com/NVIDIA/k8s-device-plugin/blob/66a35b71ac4b5cbfb04714678b548bd77e5ba719/server.go#L20
GPUResourceName = "nvidia.com/gpu"
)
Variables ¶
This section is empty.
Functions ¶
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 ¶
type Resource ¶
func EmptyResource ¶
func EmptyResource() *Resource
func NewResource ¶
func NewResource(rl v1.ResourceList) *Resource
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.
Click to show internal directories.
Click to hide internal directories.