Documentation ¶
Index ¶
Constants ¶
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 ¶
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.