balancer

package
v0.0.0-...-0713ea3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcPrioritizeNodeScore

func CalcPrioritizeNodeScore(info *nodeinfo.NodeInfo) (int, error)

CalcPrioritizeNodeScore simulates scheduler calculates the score.

Types

type Balancer

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

not need workqueue

func NewBalancer

func NewBalancer(clientset kubernetes.Interface, recyclePeriod time.Duration, ratio float64) *Balancer

func (*Balancer) BalanceNodeRes

func (b *Balancer) BalanceNodeRes(hostGSL *HostGSL)

We assume deleted pods schedule to outRightHosts and AddPod on them. When we RemovePod/AddPod it wil recalculate the score. STEP 1: resPressureOutLeftHostsMap delete pod one-by-one until the node score bigger than left. STEP 2: leftMeanHost rand delete pod one-by-one until outRightHostsMap.resFull is true.

func (*Balancer) PrioritizeNodes

func (b *Balancer) PrioritizeNodes() (*HostGSL, error)

func (*Balancer) Run

func (b *Balancer) Run(stopCh <-chan struct{})

type HostGSL

type HostGSL struct {
	HostPriorityList schedulerapi.HostPriorityList
	// contains filtered or unexported fields
}

func (*HostGSL) Calc

func (gsl *HostGSL) Calc()

func (*HostGSL) Mean

func (gsl *HostGSL) Mean() float64

func (*HostGSL) Sd

func (gsl *HostGSL) Sd() float64

func (*HostGSL) String

func (gsl *HostGSL) String() string

type NodeInfoExt

type NodeInfoExt struct {
	*nodeinfo.NodeInfo
	// contains filtered or unexported fields
}

func (*NodeInfoExt) AddPod

func (n *NodeInfoExt) AddPod(pod *v1.Pod)

func (*NodeInfoExt) GetScore

func (n *NodeInfoExt) GetScore() float64

func (*NodeInfoExt) RemovePod

func (n *NodeInfoExt) RemovePod(pod *v1.Pod)

Jump to

Keyboard shortcuts

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