generic

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeAnnotations added in v0.4.1

func MergeAnnotations(pod *v1.Pod, expandAnnotations map[string]string) map[string]string

func SetQoSEnhancementExpander added in v0.4.1

func SetQoSEnhancementExpander(e QoSEnhancementExpander)

func SetQoSLevelExpander added in v0.4.1

func SetQoSLevelExpander(e QoSLevelExpander)

Types

type AuthConfiguration added in v0.4.0

type AuthConfiguration struct {
	// Authentication type
	AuthType string

	AccessControlType string

	HttpStrictAuthentication bool
}

AuthConfiguration stores all configurations related to authentication and authorization

func NewAuthConfiguration added in v0.4.0

func NewAuthConfiguration() *AuthConfiguration

type GenericConfiguration

type GenericConfiguration struct {
	DryRun bool

	EnableHealthzCheck bool

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

	GenericEndpoint             string
	GenericEndpointHandleChains []string

	*QoSConfiguration
	*MetricsConfiguration
	*AuthConfiguration

	// 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 PodSinglePortSDConf added in v0.4.0

type PodSinglePortSDConf struct {
	PortName  string
	PodLister labels.Selector
}

func NewPodSingleSDConf added in v0.4.0

func NewPodSingleSDConf() *PodSinglePortSDConf

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
	QoSEnhancementAnnotationKey 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
	QoSEnhancementDefaultValues 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(pod *v1.Pod, expandedAnnotations 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(pod *v1.Pod, expandedAnnotations 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(pod *v1.Pod, expandedAnnotations 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(pod *v1.Pod, expandedAnnotations 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) FilterQoSAndEnhancementMap added in v0.4.1

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

func (*QoSConfiguration) FilterQoSEnhancementMap added in v0.4.1

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

FilterQoSEnhancementMap filter map that are related to 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) GetQoSEnhancementKVs added in v0.4.1

func (c *QoSConfiguration) GetQoSEnhancementKVs(pod *v1.Pod, expandedAnnotations map[string]string, enhancementKey string) (flattenedEnhancements map[string]string)

GetQoSEnhancementKVs parses enhancements from annotations by given key, since enhancement values are stored as k-v, so we should unmarshal it into maps.

func (*QoSConfiguration) GetQoSLevel

func (c *QoSConfiguration) GetQoSLevel(pod *v1.Pod, expandedAnnotations map[string]string) (qosLevel string, retErr 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) GetSpecifiedPoolName added in v0.4.0

func (c *QoSConfiguration) GetSpecifiedPoolName(pod *v1.Pod, expandedAnnotations map[string]string) (string, error)

GetSpecifiedPoolName returns the specified cpuset pool name for given enhancements and annotations;

func (*QoSConfiguration) GetSpecifiedPoolNameForPod added in v0.4.0

func (c *QoSConfiguration) GetSpecifiedPoolNameForPod(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) SetExpandQoSEnhancementKey added in v0.4.1

func (c *QoSConfiguration) SetExpandQoSEnhancementKey(enhancementKeys map[string]string)

func (*QoSConfiguration) SetExpandQoSLevelSelector

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

type QoSEnhancementExpander added in v0.4.1

type QoSEnhancementExpander interface {
	Override(flattenedEnhancements map[string]string, pod *v1.Pod, expandedAnnotations map[string]string) (map[string]string, bool)
}

QoSEnhancementExpander provides a mechanism for user-specified qos-enhancement judgement since we may need to set qos-enhancement for some customized cases

type QoSLevelExpander added in v0.4.1

type QoSLevelExpander interface {
	Override(qosLevel string, pod *v1.Pod, expandedAnnotations map[string]string) (string, bool)
}

QoSLevelExpander provides a mechanism for user-specified qos judgement since we may need to set qos-level for some customized cases

type ServiceDiscoveryConf added in v0.4.0

type ServiceDiscoveryConf struct {
	Name string

	*PodSinglePortSDConf
	*ServiceSinglePortSDConf
}

func NewServiceDiscoveryConf added in v0.4.0

func NewServiceDiscoveryConf() *ServiceDiscoveryConf

type ServiceSinglePortSDConf added in v0.4.0

type ServiceSinglePortSDConf struct {
	Namespace string
	Name      string
	PortName  string
}

func NewServiceSinglePortSDConf added in v0.4.0

func NewServiceSinglePortSDConf() *ServiceSinglePortSDConf

Jump to

Keyboard shortcuts

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