proto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceCPU CPU, in cores. (500m = .5 cores)
	ResourceCPU = "cpu"
	// ResourceMemory Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
	ResourceMemory = "memory"
	// ResourceStorage Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024)
	ResourceStorage = "storage"
)
View Source
const (
	// DefaultMilliCPURequest defines default milli cpu request number.
	DefaultMilliCPURequest int64 = 100 // 0.1 core
	// DefaultMemoryRequest defines default memory request size.
	DefaultMemoryRequest int64 = 200 * 1024 * 1024 // 200 MB
)
View Source
const (
	// DefaultCPUWeight defines default cpu weight (allowed weights go from 1 to 100)
	DefaultCPUWeight int64 = 1
	// DefaultMemoryWeight defines default memory weight (allowed weights go from 1 to 100)
	DefaultMemoryWeight int64 = 1
	// DefaultStorageWeight defines default storage weight (allowed weights go from 1 to 100)
	DefaultStorageWeight int64 = 1
)

Resources to consider when scoring. The default resource set includes "cpu" and "memory" with an equal weight.

View Source
const (
	// MaxNodeScore is the maximum score a Score plugin is expected to return.
	MaxNodeScore int64 = 100

	// MinNodeScore is the minimum score a Score plugin is expected to return.
	MinNodeScore int64 = 0

	// MaxTotalScore is the maximum total score.
	MaxTotalScore int64 = math.MaxInt64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	Node Node
	Task Task
}

type Fetch

type Fetch interface {
	Fetch(host string) Result
}

type FetchPlugin

type FetchPlugin struct {
	Impl Fetch
}

func (FetchPlugin) Client

func (FetchPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*FetchPlugin) Server

func (n *FetchPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type FetchRPC

type FetchRPC struct {
	// contains filtered or unexported fields
}

func (*FetchRPC) Fetch

func (n *FetchRPC) Fetch(host string) Result

type FetchRPCServer

type FetchRPCServer struct {
	Impl Fetch
}

func (*FetchRPCServer) Fetch

func (n *FetchRPCServer) Fetch(host string, resp *Result) error

type Label

type Label map[string]string

type Node

type Node struct {
	AllocatableResource Resource `json:"allocatableResource"`
	Label               Label    `json:"label"`
	Name                string   `json:"name"`
	RequestedResource   Resource `json:"requestedResource"`
	Unschedulable       bool     `json:"unschedulable"`
}

type Resource

type Resource struct {
	MilliCPU int64 `json:"milliCPU"`
	Memory   int64 `json:"memory"`
	Storage  int64 `json:"storage"`
}

type Result

type Result struct {
	AllocatableResource Resource
	RequestedResource   Resource
}

type Selector

type Selector map[string][]string

type Task

type Task struct {
	NodeName               string   `json:"nodeName"`
	NodeSelector           Selector `json:"nodeSelector"`
	RequestedResource      Resource `json:"requestedResource"`
	ToleratesUnschedulable bool     `json:"toleratesUnschedulable"`
}

Jump to

Keyboard shortcuts

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