executor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCoolDownSeconds = 300
)
View Source
const (
	DefaultDeletionGracePeriodSeconds = 30
)
View Source
const (
	MAX_UP_QUOTA = 60 * 1000 // 60CU
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionExecutor added in v0.2.0

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

func NewActionExecutor added in v0.2.0

func NewActionExecutor(client clientset.Interface, nodeName string, podInformer coreinformers.PodInformer, nodeInformer coreinformers.NodeInformer,
	noticeCh <-chan AvoidanceExecutor, runtimeEndpoint string) *ActionExecutor

NewActionExecutor create enforcer manager

func (*ActionExecutor) Name added in v0.2.0

func (a *ActionExecutor) Name() string

func (*ActionExecutor) Run added in v0.2.0

func (a *ActionExecutor) Run(stop <-chan struct{})

type AvoidanceExecutor

type AvoidanceExecutor struct {
	ScheduleExecutor ScheduleExecutor
	ThrottleExecutor ThrottleExecutor
	EvictExecutor    EvictExecutor
}

type CPURatio

type CPURatio struct {
	//the min of cpu ratio for pods
	MinCPURatio uint64 `json:"minCPURatio,omitempty"`

	//the step of cpu share and limit for once down-size (1-100)
	StepCPURatio uint64 `json:"stepCPURatio,omitempty"`
}

type ClassAndPriority added in v0.2.0

type ClassAndPriority struct {
	PodQOSClass        v1.PodQOSClass
	PriorityClassValue int32
}

func GetMaxQOSPriority added in v0.2.0

func GetMaxQOSPriority(podLister corelisters.PodLister, podTypes []types.NamespacedName) (types.NamespacedName, ClassAndPriority)

func (ClassAndPriority) Greater added in v0.2.0

func (s ClassAndPriority) Greater(i ClassAndPriority) bool

func (ClassAndPriority) Less added in v0.2.0

type ComparablePod added in v0.2.0

type ComparablePod struct {
	*v1.Pod
}

func (*ComparablePod) Less added in v0.2.0

func (p *ComparablePod) Less(p2 ComparablePod) bool

type ContainerUsage added in v0.2.0

type ContainerUsage struct {
	ContainerName string
	ContainerId   string
	Value         float64
}

func GetUsageById added in v0.2.0

func GetUsageById(usages []ContainerUsage, containerId string) (ContainerUsage, error)

type EvictExecutor

type EvictExecutor struct {
	EvictPods EvictPods
}

func (*EvictExecutor) Avoid

func (e *EvictExecutor) Avoid(ctx *ExecuteContext) error

func (*EvictExecutor) Restore

func (e *EvictExecutor) Restore(ctx *ExecuteContext) error

type EvictPod

type EvictPod struct {
	DeletionGracePeriodSeconds int32
	PodKey                     types.NamespacedName
	ClassAndPriority           ClassAndPriority
}

type EvictPods

type EvictPods []EvictPod

func (EvictPods) Find

func (e EvictPods) Find(key types.NamespacedName) int

func (EvictPods) Len

func (e EvictPods) Len() int

func (EvictPods) Less

func (e EvictPods) Less(i, j int) bool

func (EvictPods) Swap

func (e EvictPods) Swap(i, j int)

type ExecuteContext

type ExecuteContext struct {
	NodeName      string
	Client        clientset.Interface
	PodLister     corelisters.PodLister
	NodeLister    corelisters.NodeLister
	RuntimeClient pb.RuntimeServiceClient
	RuntimeConn   *grpc.ClientConn
}

type Executor

type Executor interface {
	Avoid(ctx *ExecuteContext) error
	Restore(ctx *ExecuteContext) error
}

type MemoryThrottleExecutor added in v0.2.0

type MemoryThrottleExecutor struct {
	// to force gc the page cache of low level pods
	ForceGC bool `json:"forceGC,omitempty"`
}

type ScheduleExecutor added in v0.2.0

type ScheduleExecutor struct {
	DisableClassAndPriority *ClassAndPriority
	RestoreClassAndPriority *ClassAndPriority
}

func (*ScheduleExecutor) Avoid added in v0.2.0

func (b *ScheduleExecutor) Avoid(ctx *ExecuteContext) error

func (*ScheduleExecutor) Restore added in v0.2.0

func (b *ScheduleExecutor) Restore(ctx *ExecuteContext) error

type ThrottleExecutor

type ThrottleExecutor struct {
	ThrottleDownPods ThrottlePods
	ThrottleUpPods   ThrottlePods
}

func (*ThrottleExecutor) Avoid

func (t *ThrottleExecutor) Avoid(ctx *ExecuteContext) error

func (*ThrottleExecutor) Restore

func (t *ThrottleExecutor) Restore(ctx *ExecuteContext) error

type ThrottlePod added in v0.2.0

type ThrottlePod struct {
	CPUThrottle         CPURatio
	MemoryThrottle      MemoryThrottleExecutor
	PodTypes            types.NamespacedName
	PodCPUUsage         float64
	ContainerCPUUsages  []ContainerUsage
	PodCPUShare         float64
	ContainerCPUShares  []ContainerUsage
	PodCPUQuota         float64
	ContainerCPUQuotas  []ContainerUsage
	PodCPUPeriod        float64
	ContainerCPUPeriods []ContainerUsage
	PodQOSPriority      ClassAndPriority
}

type ThrottlePods added in v0.2.0

type ThrottlePods []ThrottlePod

func (ThrottlePods) Find added in v0.2.0

func (t ThrottlePods) Find(podTypes types.NamespacedName) int

func (ThrottlePods) Len added in v0.2.0

func (t ThrottlePods) Len() int

func (ThrottlePods) Less added in v0.2.0

func (t ThrottlePods) Less(i, j int) bool

func (ThrottlePods) Swap added in v0.2.0

func (t ThrottlePods) Swap(i, j int)

Jump to

Keyboard shortcuts

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