pkg

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PodProvisioner = "kc.k-cloud-labs.io/provisioned-by"
	SchedulerName  = "simulator-scheduler"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Framework

type Framework interface {
	Run() error
	InitTheWorld(objs ...runtime.Object) error
	CreatePod(pod *corev1.Pod) error
	UpdateEstimationPods(pod ...*corev1.Pod)
	UpdateNodesToScaleDown(nodeName string)
	Status() *Status
	GetPodsByNode(nodeName string) ([]*corev1.Pod, error)
	Stop(reason string) error
}

Framework need to be implemented by all scheduler framework

type Printer

type Printer interface {
	Print(verbose bool, format string) error
}

type Simulator

type Simulator interface {
	Run() error
	Initialize(objs ...runtime.Object) error
	Report() Printer
}

Simulator need to be implemented by all simulator

type Status

type Status struct {
	// all pods
	Pods []corev1.Pod `json:"pods"`
	// all nodes
	Nodes map[string]corev1.Node `json:"nodes"`
	// for ce
	PodsForEstimation []*corev1.Pod `json:"pods_for_estimation"`
	// for cc
	NodesToScaleDown     []string `json:"nodes_to_scale_down"`
	SelectNodeCount      int      `json:"select_node_count"`
	SchedulerCount       int      `json:"scheduler_count"`
	FailedSchedulerCount int      `json:"failed_scheduler_count"`
	// stop reason
	StopReason string `json:"stop_reason"`
}

Status capture all scheduled pods with reason why the estimation could not continue

func (*Status) FailedSchedulerCountInc

func (s *Status) FailedSchedulerCountInc()

func (*Status) SchedulerCountInc

func (s *Status) SchedulerCountInc()

func (*Status) SelectNodeCountInc

func (s *Status) SelectNodeCountInc()

Directories

Path Synopsis
plugins
simulator

Jump to

Keyboard shortcuts

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