config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonColocationConfigUnmarshalFailed = "ColocationCfgUnmarshalFailed"
	ReasonSLOConfigUnmarshalFailed        = "SLOCfgUnmarshalFailed"
)
View Source
const (
	// keys in the configmap
	ColocationConfigKey        = "colocation-config"
	ResourceThresholdConfigKey = "resource-threshold-config"
	ResourceQOSConfigKey       = "resource-qos-config"
	CPUBurstConfigKey          = "cpu-burst-config"
)

Variables

View Source
var (
	// SLO configmap name
	ConfigNameSpace  = "koordinator-system"
	SLOCtrlConfigMap = "slo-controller-config"
)

Functions

func GetConfigMapForCache added in v0.7.0

func GetConfigMapForCache(client client.Client) (*corev1.ConfigMap, error)

func InitFlags added in v0.6.0

func InitFlags(fs *flag.FlagSet)

func IsColocationStrategyValid

func IsColocationStrategyValid(strategy *ColocationStrategy) bool

func IsNodeColocationCfgValid

func IsNodeColocationCfgValid(nodeCfg *NodeColocationCfg) bool

func RegisterDefaultColocationExtension added in v0.7.0

func RegisterDefaultColocationExtension(key string, extension interface{}) error

func UnregisterDefaultColocationExtension added in v0.7.0

func UnregisterDefaultColocationExtension(key string)

Types

type CPUBurstCfg added in v0.3.0

type CPUBurstCfg struct {
	ClusterStrategy *slov1alpha1.CPUBurstStrategy `json:"clusterStrategy,omitempty"`
	NodeStrategies  []NodeCPUBurstCfg             `json:"nodeStrategies,omitempty"`
}

+k8s:deepcopy-gen=true

func (*CPUBurstCfg) DeepCopy added in v0.5.0

func (in *CPUBurstCfg) DeepCopy() *CPUBurstCfg

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUBurstCfg.

func (*CPUBurstCfg) DeepCopyInto added in v0.5.0

func (in *CPUBurstCfg) DeepCopyInto(out *CPUBurstCfg)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CalculatePolicy added in v1.0.0

type CalculatePolicy string
const (
	CalculateByPodUsage   CalculatePolicy = "usage"
	CalculateByPodRequest CalculatePolicy = "request"
)

type ColocationCfg

type ColocationCfg struct {
	ColocationStrategy `json:",inline"`
	NodeConfigs        []NodeColocationCfg `json:"nodeConfigs,omitempty"`
}

TODO move under apis in the next PR +k8s:deepcopy-gen=true

func DefaultColocationCfg

func DefaultColocationCfg() ColocationCfg

func NewDefaultColocationCfg

func NewDefaultColocationCfg() *ColocationCfg

func (*ColocationCfg) DeepCopy added in v0.5.0

func (in *ColocationCfg) DeepCopy() *ColocationCfg

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ColocationCfg.

func (*ColocationCfg) DeepCopyInto added in v0.5.0

func (in *ColocationCfg) DeepCopyInto(out *ColocationCfg)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ColocationCfgCache added in v0.5.0

type ColocationCfgCache interface {
	GetCfgCopy() *ColocationCfg
	IsCfgAvailable() bool
	IsErrorStatus() bool
}

type ColocationHandlerForConfigMapEvent added in v0.5.0

type ColocationHandlerForConfigMapEvent struct {
	EnqueueRequestForConfigMap

	Client client.Client
	// contains filtered or unexported fields
}

func NewColocationHandlerForConfigMapEvent added in v0.5.0

func NewColocationHandlerForConfigMapEvent(client client.Client, initCfg ColocationCfg, recorder record.EventRecorder) *ColocationHandlerForConfigMapEvent

func (*ColocationHandlerForConfigMapEvent) GetCfgCopy added in v0.7.0

func (*ColocationHandlerForConfigMapEvent) IsCfgAvailable added in v0.7.0

func (p *ColocationHandlerForConfigMapEvent) IsCfgAvailable() bool

func (*ColocationHandlerForConfigMapEvent) IsErrorStatus added in v0.7.0

func (p *ColocationHandlerForConfigMapEvent) IsErrorStatus() bool

type ColocationStrategy

type ColocationStrategy struct {
	Enable                         *bool            `json:"enable,omitempty"`
	MetricAggregateDurationSeconds *int64           `json:"metricAggregateDurationSeconds,omitempty"`
	MetricReportIntervalSeconds    *int64           `json:"metricReportIntervalSeconds,omitempty"`
	CPUReclaimThresholdPercent     *int64           `json:"cpuReclaimThresholdPercent,omitempty"`
	MemoryReclaimThresholdPercent  *int64           `json:"memoryReclaimThresholdPercent,omitempty"`
	MemoryCalculatePolicy          *CalculatePolicy `json:"memoryCalculatePolicy,omitempty"`
	DegradeTimeMinutes             *int64           `json:"degradeTimeMinutes,omitempty"`
	UpdateTimeThresholdSeconds     *int64           `json:"updateTimeThresholdSeconds,omitempty"`
	ResourceDiffThreshold          *float64         `json:"resourceDiffThreshold,omitempty"`
	ColocationStrategyExtender     `json:",inline"` // for third-party extension
}

+k8s:deepcopy-gen=true

func DefaultColocationStrategy

func DefaultColocationStrategy() ColocationStrategy

func GetNodeColocationStrategy

func GetNodeColocationStrategy(cfg *ColocationCfg, node *corev1.Node) *ColocationStrategy

func (*ColocationStrategy) DeepCopy added in v0.5.0

func (in *ColocationStrategy) DeepCopy() *ColocationStrategy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ColocationStrategy.

func (*ColocationStrategy) DeepCopyInto added in v0.5.0

func (in *ColocationStrategy) DeepCopyInto(out *ColocationStrategy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ColocationStrategyExtender added in v0.7.0

type ColocationStrategyExtender struct {
	Extensions ExtraFields `json:"extensions,omitempty"`
}

+k8s:deepcopy-gen=true

func (*ColocationStrategyExtender) DeepCopy added in v0.7.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ColocationStrategyExtender.

func (*ColocationStrategyExtender) DeepCopyInto added in v0.7.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnqueueRequestForConfigMap added in v0.5.0

type EnqueueRequestForConfigMap struct {
	EnqueueRequest     func(q *workqueue.RateLimitingInterface)
	SyncCacheIfChanged func(configMap *corev1.ConfigMap) bool
}

func (*EnqueueRequestForConfigMap) Create added in v0.5.0

func (*EnqueueRequestForConfigMap) Delete added in v0.5.0

func (*EnqueueRequestForConfigMap) Generic added in v0.5.0

func (*EnqueueRequestForConfigMap) Update added in v0.5.0

type ExtraFields added in v0.7.0

type ExtraFields map[string]interface{}

+k8s:deepcopy-gen=false

func (*ExtraFields) DeepCopy added in v0.7.0

func (in *ExtraFields) DeepCopy() *ExtraFields

func (*ExtraFields) DeepCopyInto added in v0.7.0

func (in *ExtraFields) DeepCopyInto(out *ExtraFields)

type NodeCPUBurstCfg added in v0.3.0

type NodeCPUBurstCfg struct {
	// an empty label selector matches all objects while a nil label selector matches no objects
	NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"`
	*slov1alpha1.CPUBurstStrategy
}

+k8s:deepcopy-gen=true

func (*NodeCPUBurstCfg) DeepCopy added in v0.5.0

func (in *NodeCPUBurstCfg) DeepCopy() *NodeCPUBurstCfg

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeCPUBurstCfg.

func (*NodeCPUBurstCfg) DeepCopyInto added in v0.5.0

func (in *NodeCPUBurstCfg) DeepCopyInto(out *NodeCPUBurstCfg)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeColocationCfg

type NodeColocationCfg struct {
	NodeSelector *metav1.LabelSelector
	ColocationStrategy
}

+k8s:deepcopy-gen=true

func (*NodeColocationCfg) DeepCopy added in v0.5.0

func (in *NodeColocationCfg) DeepCopy() *NodeColocationCfg

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeColocationCfg.

func (*NodeColocationCfg) DeepCopyInto added in v0.5.0

func (in *NodeColocationCfg) DeepCopyInto(out *NodeColocationCfg)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeResourceQOSStrategy added in v0.6.0

type NodeResourceQOSStrategy struct {
	// an empty label selector matches all objects while a nil label selector matches no objects
	NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"`
	*slov1alpha1.ResourceQOSStrategy
}

+k8s:deepcopy-gen=true

func (*NodeResourceQOSStrategy) DeepCopy added in v0.6.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourceQOSStrategy.

func (*NodeResourceQOSStrategy) DeepCopyInto added in v0.6.0

func (in *NodeResourceQOSStrategy) DeepCopyInto(out *NodeResourceQOSStrategy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeResourceThresholdStrategy

type NodeResourceThresholdStrategy struct {
	// an empty label selector matches all objects while a nil label selector matches no objects
	NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"`
	*slov1alpha1.ResourceThresholdStrategy
}

+k8s:deepcopy-gen=true

func (*NodeResourceThresholdStrategy) DeepCopy added in v0.5.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourceThresholdStrategy.

func (*NodeResourceThresholdStrategy) DeepCopyInto added in v0.5.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceQOSCfg added in v0.6.0

type ResourceQOSCfg struct {
	ClusterStrategy *slov1alpha1.ResourceQOSStrategy `json:"clusterStrategy,omitempty"`
	NodeStrategies  []NodeResourceQOSStrategy        `json:"nodeStrategies,omitempty"`
}

+k8s:deepcopy-gen=true

func (*ResourceQOSCfg) DeepCopy added in v0.6.0

func (in *ResourceQOSCfg) DeepCopy() *ResourceQOSCfg

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQOSCfg.

func (*ResourceQOSCfg) DeepCopyInto added in v0.6.0

func (in *ResourceQOSCfg) DeepCopyInto(out *ResourceQOSCfg)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceThresholdCfg

type ResourceThresholdCfg struct {
	ClusterStrategy *slov1alpha1.ResourceThresholdStrategy `json:"clusterStrategy,omitempty"`
	NodeStrategies  []NodeResourceThresholdStrategy        `json:"nodeStrategies,omitempty"`
}

+k8s:deepcopy-gen=true

func (*ResourceThresholdCfg) DeepCopy added in v0.5.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceThresholdCfg.

func (*ResourceThresholdCfg) DeepCopyInto added in v0.5.0

func (in *ResourceThresholdCfg) DeepCopyInto(out *ResourceThresholdCfg)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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