annotator

package
v0.0.0-...-c2c0533 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HotValueKey    = "node_hot_value"
	DefaultBackOff = 10 * time.Second
	MaxBackOff     = 360 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Node      string
	Namespace string
	PodName   string
	Timestamp int64
}

Binding is a concise struction of pod binding records, which consists of pod name, namespace name, node name and accurate timestamp. Note that we only record temporary Binding imformation.

type BindingHeap

type BindingHeap []*Binding

BindingHeap is a Heap struction storing Binding imfromation.

func (BindingHeap) Len

func (b BindingHeap) Len() int

func (BindingHeap) Less

func (b BindingHeap) Less(i, j int) bool

func (*BindingHeap) Pop

func (b *BindingHeap) Pop() interface{}

func (*BindingHeap) Push

func (b *BindingHeap) Push(x interface{})

func (BindingHeap) Swap

func (b BindingHeap) Swap(i, j int)

type BindingRecords

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

BindingRecords relizes an Binding heap, which limits heap size, and recycles automatically, contributing to store latest and least imformation.

func NewBindingRecords

func NewBindingRecords(size int32, tr time.Duration) *BindingRecords

NewBindingRecords returns an BindingRecords object.

func (*BindingRecords) AddBinding

func (br *BindingRecords) AddBinding(b *Binding)

AddBinding add new Binding to BindingHeap.

func (*BindingRecords) BindingsGC

func (br *BindingRecords) BindingsGC()

BindingsGC recycles expired Bindings.

func (*BindingRecords) GetLastNodeBindingCount

func (br *BindingRecords) GetLastNodeBindingCount(node string, timeRange time.Duration) int

GetLastNodeBindingCount caculates how many pods scheduled on specified node recently.

type Controller

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

Controller is Controller for node annotator.

func NewNodeAnnotator

func NewNodeAnnotator(
	nodeInformer coreinformers.NodeInformer,
	eventInformer coreinformers.EventInformer,
	kubeClient clientset.Interface,
	promClient prom.PromClient,
	policy policy.DynamicSchedulerPolicy,
	bingdingHeapSize int32,
) *Controller

NewController returns a Node Annotator object.

func (*Controller) Run

func (c *Controller) Run(worker int, stopCh <-chan struct{}) error

Run runs node annotator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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