sloconfig

package
v1.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ReasonOverlap          = err.Reason("NodeStrategiesOverlap")
	ReasonExistNodeConfict = err.Reason("ExistNodeConfict")
	ReasonParseFail        = err.Reason("ParseConfigFail")
	ReasonParamInvalid     = err.Reason("ConfigParamInvalid")
)
View Source
const InitSuccess = "Success"
View Source
const NotInit = "NotInit"
View Source
const (
	PluginName = "SLOConfig"
)

Variables

This section is empty.

Functions

func CreateCheckersAll

func CreateCheckersAll(oldConfig *corev1.ConfigMap, config *corev1.ConfigMap, needUnmarshal bool) checkers

func CreateCheckersChanged

func CreateCheckersChanged(oldConfig *corev1.ConfigMap, config *corev1.ConfigMap) checkers

Types

type CPUBurstChecker

type CPUBurstChecker struct {
	CommonChecker
	// contains filtered or unexported fields
}

func NewCPUBurstChecker

func NewCPUBurstChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *CPUBurstChecker

func (*CPUBurstChecker) ConfigParamValid

func (c *CPUBurstChecker) ConfigParamValid() error

type ColocationConfigChecker

type ColocationConfigChecker struct {
	CommonChecker
	// contains filtered or unexported fields
}

func NewColocationConfigChecker

func NewColocationConfigChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *ColocationConfigChecker

func (*ColocationConfigChecker) ConfigParamValid

func (c *ColocationConfigChecker) ConfigParamValid() error

type CommonChecker

type CommonChecker struct {
	OldConfigMap *corev1.ConfigMap
	NewConfigMap *corev1.ConfigMap

	NodeConfigProfileChecker
	// contains filtered or unexported fields
}

func (*CommonChecker) CheckByValidator

func (c *CommonChecker) CheckByValidator(config interface{}) error

func (*CommonChecker) InitStatus

func (c *CommonChecker) InitStatus() string

func (*CommonChecker) IsCfgNotEmptyAndChanged

func (c *CommonChecker) IsCfgNotEmptyAndChanged() bool

type ConfigChecker

type ConfigChecker interface {
	IsCfgNotEmptyAndChanged() bool
	InitStatus() string
	ConfigParamValid() error
	NodeConfigProfileChecker
}

type ExsitNodeConflictMessage

type ExsitNodeConflictMessage struct {
	Config                 string   `json:"config,omitempty"`
	ConflictNodeStrategies []string `json:"strategies,omitempty"`
	ExampleNodes           []string `json:"exampleNodes,omitempty"`
}

type NodeConfigProfileChecker

type NodeConfigProfileChecker interface {
	HasMultiNodeConfigs() bool                 //nodeConfigs nums > 1
	ProfileParamValid() error                  //name must not conflict
	NodeSelectorOverlap() error                //check nodeselector if overlap
	ExistNodeConflict(node *corev1.Node) error //check a node if exist conflict
}

func CreateNodeConfigProfileChecker

func CreateNodeConfigProfileChecker(configName string, profiles func() []configuration.NodeCfgProfile) (NodeConfigProfileChecker, error)

type ResourceQOSChecker

type ResourceQOSChecker struct {
	CommonChecker
	// contains filtered or unexported fields
}

func NewResourceQOSChecker

func NewResourceQOSChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *ResourceQOSChecker

func (*ResourceQOSChecker) ConfigParamValid

func (c *ResourceQOSChecker) ConfigParamValid() error

type ResourceThresholdChecker

type ResourceThresholdChecker struct {
	CommonChecker
	// contains filtered or unexported fields
}

func NewResourceThresholdChecker

func NewResourceThresholdChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *ResourceThresholdChecker

func (*ResourceThresholdChecker) ConfigParamValid

func (c *ResourceThresholdChecker) ConfigParamValid() error

type SLOControllerPlugin

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

func NewPlugin

func NewPlugin(decoder *ctrladmission.Decoder, client ctrlclient.Client) *SLOControllerPlugin

func (*SLOControllerPlugin) Admit

func (cl *SLOControllerPlugin) Admit(ctx context.Context, req ctrladmission.Request, config, oldConfig *corev1.ConfigMap) error

func (*SLOControllerPlugin) Name

func (cl *SLOControllerPlugin) Name() string

func (*SLOControllerPlugin) Validate

func (cl *SLOControllerPlugin) Validate(ctx context.Context, req ctrladmission.Request, config, oldConfig *corev1.ConfigMap) error

type SystemConfigChecker

type SystemConfigChecker struct {
	CommonChecker
	// contains filtered or unexported fields
}

func NewSystemConfigChecker

func NewSystemConfigChecker(oldConfig, newConfig *corev1.ConfigMap, needUnmarshal bool) *SystemConfigChecker

func (*SystemConfigChecker) ConfigParamValid

func (c *SystemConfigChecker) ConfigParamValid() error

Jump to

Keyboard shortcuts

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