scheduler

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Config config.Config
	Data   Proto
}

func DefaultConfig

func DefaultConfig() *Config

type Metadata

type Metadata struct {
	Name string `json:"name"`
}

type Node

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

type Proto

type Proto struct {
	ApiVersion string   `json:"apiVersion"`
	Kind       string   `json:"kind"`
	Metadata   Metadata `json:"metadata"`
	Spec       Spec     `json:"spec"`
}

type Resource

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

type Result

type Result struct {
	Name  string `json:"name"`
	Error string `json:"error"`
}

type Scheduler

type Scheduler interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) (Result, error)
}

func New

func New(_ context.Context, cfg *Config) Scheduler

type Spec

type Spec struct {
	Task  Task   `json:"task"`
	Nodes []Node `json:"nodes"`
}

type Task

type Task struct {
	Name                   string   `json:"name"`
	NodeName               string   `json:"nodeName"`
	NodeSelectors          []string `json:"nodeSelectors"`
	RequestedResource      Resource `json:"requestedResource"`
	ToleratesUnschedulable bool     `json:"toleratesUnschedulable"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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