framework

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ClearQOSGreyCtrlPlugin

func ClearQOSGreyCtrlPlugin()

func InjectQOSGreyCtrlPlugins

func InjectQOSGreyCtrlPlugins(pod *corev1.Pod, policyType QOSPolicyType, policy *interface{}) bool

func RegisterQOSExtPlugin

func RegisterQOSExtPlugin(feature featuregate.Feature, featureSpec featuregate.FeatureSpec,
	plugin ExtensionPlugin) error

func RegisterQOSGreyCtrlPlugin

func RegisterQOSGreyCtrlPlugin(name string, plugin QOSGreyControlPlugin) error

func RunQOSGreyCtrlPlugins

func RunQOSGreyCtrlPlugins(client clientset.Interface, stopCh <-chan struct{})

func SetupPlugins

func SetupPlugins(client clientset.Interface, metricCache metriccache.MetricCache, statesInformer statesinformer.StatesInformer)

func StartPlugins

func StartPlugins(cfg *QOSExtensionConfig, stopCh <-chan struct{}) error

func UnregisterQOSGreyCtrlPlugin

func UnregisterQOSGreyCtrlPlugin(name string)

Types

type Config

type Config struct {
	ReconcileIntervalSeconds   int
	CPUSuppressIntervalSeconds int
	CPUEvictIntervalSeconds    int
	MemoryEvictIntervalSeconds int
	MemoryEvictCoolTimeSeconds int
	CPUEvictCoolTimeSeconds    int
	OnlyEvictByAPI             bool
	QOSExtensionCfg            *QOSExtensionConfig
}

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) InitFlags

func (c *Config) InitFlags(fs *flag.FlagSet)

type Context

type Context struct {
	Evictor    *Evictor
	Strategies map[string]QOSStrategy
}

type Evictor

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

func NewEvictor

func NewEvictor(kubeClient clientset.Interface, eventRecorder record.EventRecorder, evictVersion string) *Evictor

func (*Evictor) EvictPodIfNotEvicted added in v1.5.0

func (r *Evictor) EvictPodIfNotEvicted(evictPod *corev1.Pod, node *corev1.Node, reason string, message string) bool

func (*Evictor) EvictPodsIfNotEvicted

func (r *Evictor) EvictPodsIfNotEvicted(evictPods []*corev1.Pod, node *corev1.Node, reason string, message string)

func (*Evictor) IsPodEvicted added in v1.5.0

func (r *Evictor) IsPodEvicted(pod *corev1.Pod) bool

func (*Evictor) Start

func (r *Evictor) Start(stopCh <-chan struct{}) error

type ExtensionPlugin

type ExtensionPlugin interface {
	InitFlags(fs *flag.FlagSet)
	Setup(client clientset.Interface, metricCache metriccache.MetricCache, statesInformer statesinformer.StatesInformer)
	Run(stopCh <-chan struct{})
}

type Options

type Options struct {
	CgroupReader        resourceexecutor.CgroupReader
	StatesInformer      statesinformer.StatesInformer
	MetricCache         metriccache.MetricCache
	EventRecorder       record.EventRecorder
	KubeClient          clientset.Interface
	EvictVersion        string
	Config              *Config
	MetricAdvisorConfig *ma.Config
}

type QOSExtensionConfig

type QOSExtensionConfig struct {
	FeatureGates map[string]bool
}

func (*QOSExtensionConfig) InitFlags

func (c *QOSExtensionConfig) InitFlags(fs *flag.FlagSet)

type QOSGreyControlPlugin

type QOSGreyControlPlugin interface {
	Setup(kubeClient clientset.Interface) error
	Run(stopCh <-chan struct{})
	InjectPodPolicy(pod *corev1.Pod, policyType QOSPolicyType, greyCtlPolicy *interface{}) (bool, error)
}

type QOSPolicyType

type QOSPolicyType string
const (
	QOSPolicyCPUBurst  QOSPolicyType = "CPUBurst"
	QOSPolicyMemoryQOS QOSPolicyType = "MemoryQOS"
)

type QOSStrategy

type QOSStrategy interface {
	Enabled() bool
	Setup(*Context)
	Run(stopCh <-chan struct{})
}

type QOSStrategyFactory

type QOSStrategyFactory = func(opt *Options) QOSStrategy

Jump to

Keyboard shortcuts

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