generic

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericConfiguration

type GenericConfiguration struct {
	DryRun bool

	// for some cases, we may need to enable the ability of transformed informer
	TransformedInformerForPod bool

	GenericEndpoint             string
	GenericEndpointHandleChains []string
	GenericAuthStaticUser       string
	GenericAuthStaticPasswd     string

	*QoSConfiguration
	*MetricsConfiguration

	// ClientConnection specifies the kubeconfig file and client connection
	// settings for the proxy server to use when communicating with the apiserver.
	ClientConnection componentbaseconfig.ClientConnectionConfiguration
}

GenericConfiguration stores all the generic configurations needed by core katalyst components

func NewGenericConfiguration

func NewGenericConfiguration() *GenericConfiguration

NewGenericConfiguration creates a new generic configuration.

type MetricsConfiguration

type MetricsConfiguration struct {
	EmitterPrometheusGCTimeout time.Duration
}

MetricsConfiguration defines metrics used by metrics, including all kinds of metrics implementations and metrics pool implementations.

func NewMetricsConfiguration

func NewMetricsConfiguration() *MetricsConfiguration

type QoSConfiguration

type QoSConfiguration struct {
	sync.RWMutex

	// QoSClassAnnotationSelector is used as an expanded way to match legacy specified
	// QoS annotations into standard katalyst QoS level
	// - if no expended selector is configured
	// --- only use the default key-value instead
	// - if multiple expended selectors are defined
	// --- returns true if anyone matches
	// - we should also do validation
	QoSClassAnnotationSelector map[string]map[string]string

	// QoSEnhancementAnnotationKey is used as an expanded way to match legacy specified
	// QoS annotations into standard katalyst QoS enhancement
	QoSEnhancementAnnotationSelector map[string]string

	// for different situation, there may be different default values for enhancement keys
	// we use options to control those different values
	// the key here is specific enhancement key such as "numa_binding", "numa_exclusive"
	// the value is the default value of the key
	EnhancementDefaultValues map[string]string
	// contains filtered or unexported fields
}

QoSConfiguration stores the qos configurations needed by core katalyst components. since we may have legacy QoS judgement ways, we should map those legacy configs into standard katalyst QoS Level.

func NewQoSConfiguration

func NewQoSConfiguration() *QoSConfiguration

NewQoSConfiguration creates a new qos configuration.

func (*QoSConfiguration) CheckDedicatedQoS

func (c *QoSConfiguration) CheckDedicatedQoS(annotations map[string]string) (bool, error)

CheckDedicatedQoS returns true if the annotation indicates for DedicatedCores; - returns error if different QoS configurations conflict with each other.

func (*QoSConfiguration) CheckDedicatedQoSForPod

func (c *QoSConfiguration) CheckDedicatedQoSForPod(pod *v1.Pod) (bool, error)

func (*QoSConfiguration) CheckReclaimedQoS

func (c *QoSConfiguration) CheckReclaimedQoS(annotations map[string]string) (bool, error)

CheckReclaimedQoS returns true if the annotation indicates for ReclaimedCores; - returns error if different QoS configurations conflict with each other.

func (*QoSConfiguration) CheckReclaimedQoSForPod

func (c *QoSConfiguration) CheckReclaimedQoSForPod(pod *v1.Pod) (bool, error)

func (*QoSConfiguration) CheckSharedQoS

func (c *QoSConfiguration) CheckSharedQoS(annotations map[string]string) (bool, error)

CheckSharedQoS returns true if the annotation indicates for SharedCores; - returns error if different QoS configurations conflict with each other.

func (*QoSConfiguration) CheckSharedQoSForPod

func (c *QoSConfiguration) CheckSharedQoSForPod(pod *v1.Pod) (bool, error)

func (*QoSConfiguration) CheckSystemQoS

func (c *QoSConfiguration) CheckSystemQoS(annotations map[string]string) (bool, error)

CheckSystemQoS returns true if the annotation indicates for SystemCores; - returns error if different QoS configurations conflict with each other.

func (*QoSConfiguration) CheckSystemQoSForPod

func (c *QoSConfiguration) CheckSystemQoSForPod(pod *v1.Pod) (bool, error)

func (*QoSConfiguration) FilterQoSAndEnhancement

func (c *QoSConfiguration) FilterQoSAndEnhancement(annotations map[string]string) (map[string]string, error)

FilterQoSAndEnhancement filter map that are related to katalyst QoS and katalyst Enhancement. for enhancements,we should unmarshal and store the unmarshal key-value. it works both for default katalyst QoS keys and expanded QoS keys.

func (*QoSConfiguration) FilterQoSMap

func (c *QoSConfiguration) FilterQoSMap(annotations map[string]string) map[string]string

FilterQoSMap filter map that are related to katalyst QoS. it works both for default katalyst QoS keys and expanded QoS keys

func (*QoSConfiguration) GetQoSEnhancements

func (c *QoSConfiguration) GetQoSEnhancements(annotations map[string]string) map[string]string

GetQoSEnhancements returns the standard katalyst QoS Enhancement Map for given annotations; - ignore conflict cases: default enhancement key always prior to expand enhancement key

func (*QoSConfiguration) GetQoSEnhancementsForPod

func (c *QoSConfiguration) GetQoSEnhancementsForPod(pod *v1.Pod) map[string]string

func (*QoSConfiguration) GetQoSLevel

func (c *QoSConfiguration) GetQoSLevel(annotations map[string]string) (string, error)

GetQoSLevel returns the standard katalyst QoS Level for given annotations; - returns error if there is conflict in qos level annotations or can't get valid qos level. - returns defaultQoSLevel if nothing matches and isNotDefaultQoSLevel is false.

func (*QoSConfiguration) GetQoSLevelForPod

func (c *QoSConfiguration) GetQoSLevelForPod(pod *v1.Pod) (string, error)

func (*QoSConfiguration) SetEnhancementDefaultValues added in v0.2.0

func (c *QoSConfiguration) SetEnhancementDefaultValues(enhancementDefaultValues map[string]string)

SetEnhancementDefaultValues set default values for enhancement keys because sometimes we need different default values for enhancement keys in different types of clusters

func (*QoSConfiguration) SetExpandQoSEnhancementSelector

func (c *QoSConfiguration) SetExpandQoSEnhancementSelector(enhancementAdapter map[string]string)

func (*QoSConfiguration) SetExpandQoSLevelSelector

func (c *QoSConfiguration) SetExpandQoSLevelSelector(qosLevel string, selectorMap map[string]string)

Jump to

Keyboard shortcuts

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