config

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDeschedulerPort         = 10258
	DefaultInsecureDeschedulerPort = 10251
)
View Source
const GroupName = "descheduler"

GroupName is the group name use in this package

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
	Scheme        = runtime.NewScheme()
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ArbitrationArgs added in v1.4.0

type ArbitrationArgs struct {
	// Enabled defines if Arbitration Mechanism should be enabled.
	// Default is true
	Enabled bool

	// Interval defines the running interval (ms) of the Arbitration Mechanism.
	// Default is 500 ms
	Interval *metav1.Duration
}

ArbitrationArgs holds arguments used to configure the Arbitration Mechanism.

func (*ArbitrationArgs) DeepCopy added in v1.4.0

func (in *ArbitrationArgs) DeepCopy() *ArbitrationArgs

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

func (*ArbitrationArgs) DeepCopyInto added in v1.4.0

func (in *ArbitrationArgs) DeepCopyInto(out *ArbitrationArgs)

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

type DeschedulerConfiguration

type DeschedulerConfiguration struct {
	metav1.TypeMeta

	// LeaderElection defines the configuration of leader election client.
	LeaderElection config.LeaderElectionConfiguration

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

	// DebuggingConfiguration holds configuration for Debugging related features
	// TODO: We might wanna make this a substruct like Debugging componentbaseconfig.DebuggingConfiguration
	config.DebuggingConfiguration

	// HealthzBindAddress is the IP address and port for the health check server to serve on.
	HealthzBindAddress string
	// MetricsBindAddress is the IP address and port for the metrics server to serve on.
	MetricsBindAddress string

	// Time interval for descheduler to run
	DeschedulingInterval metav1.Duration

	// Dry run
	DryRun bool

	// Profiles are descheduling profiles that koord-descheduler supports.
	Profiles []DeschedulerProfile

	// NodeSelector for a set of nodes to operate over
	NodeSelector *metav1.LabelSelector

	// MaxNoOfPodsToEvictPerNode restricts maximum of pods to be evicted per node.
	MaxNoOfPodsToEvictPerNode *uint

	// MaxNoOfPodsToEvictPerNamespace restricts maximum of pods to be evicted per namespace.
	MaxNoOfPodsToEvictPerNamespace *uint
}

DeschedulerConfiguration configures a descheduler

func (*DeschedulerConfiguration) DeepCopy

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

func (*DeschedulerConfiguration) DeepCopyInto

func (in *DeschedulerConfiguration) DeepCopyInto(out *DeschedulerConfiguration)

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

func (*DeschedulerConfiguration) DeepCopyObject

func (in *DeschedulerConfiguration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DeschedulerProfile

type DeschedulerProfile struct {
	Name         string
	PluginConfig []PluginConfig
	Plugins      *Plugins
}

DeschedulerProfile is a descheduling profile.

func (*DeschedulerProfile) DeepCopy

func (in *DeschedulerProfile) DeepCopy() *DeschedulerProfile

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

func (*DeschedulerProfile) DeepCopyInto

func (in *DeschedulerProfile) DeepCopyInto(out *DeschedulerProfile)

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

type Float64OrString added in v1.2.0

type Float64OrString struct {
	Type     Type
	FloatVal float64
	StrVal   string
}

func (*Float64OrString) DeepCopy added in v1.2.0

func (in *Float64OrString) DeepCopy() *Float64OrString

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

func (*Float64OrString) DeepCopyInto added in v1.2.0

func (in *Float64OrString) DeepCopyInto(out *Float64OrString)

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

func (*Float64OrString) FloatValue added in v1.2.0

func (floatstr *Float64OrString) FloatValue() float64

FloatValue returns the FloatVal if type Float, or if it is a String, will attempt a conversion to float64, returning 0 if a parsing error occurs.

func (*Float64OrString) MarshalJSON added in v1.2.0

func (floatstr *Float64OrString) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

func (*Float64OrString) String added in v1.2.0

func (floatstr *Float64OrString) String() string

String returns the string value, or the Itoa of the float value.

func (*Float64OrString) UnmarshalJSON added in v1.2.0

func (floatstr *Float64OrString) UnmarshalJSON(value []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

type LoadAnomalyCondition added in v1.2.0

type LoadAnomalyCondition struct {
	// Timeout indicates the expiration time of the abnormal state, the default is 1 minute
	Timeout metav1.Duration
	// ConsecutiveAbnormalities indicates the number of consecutive abnormalities
	ConsecutiveAbnormalities uint32
	// ConsecutiveNormalities indicates the number of consecutive normalities
	ConsecutiveNormalities uint32
}

func (*LoadAnomalyCondition) DeepCopy added in v1.2.0

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

func (*LoadAnomalyCondition) DeepCopyInto added in v1.2.0

func (in *LoadAnomalyCondition) DeepCopyInto(out *LoadAnomalyCondition)

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

type LowNodeLoadArgs added in v1.1.0

type LowNodeLoadArgs struct {
	metav1.TypeMeta

	// Paused indicates whether the LoadHotspot should to work or not.
	// Default is false
	Paused bool

	// DryRun means only execute the entire deschedule logic but don't migrate Pod
	// Default is false
	DryRun bool

	// NumberOfNodes can be configured to activate the strategy only when the number of under utilized nodes are above the configured value.
	// This could be helpful in large clusters where a few nodes could go under utilized frequently or for a short period of time.
	// By default, NumberOfNodes is set to zero.
	NumberOfNodes int32

	// NodeMetricExpirationSeconds indicates the NodeMetric expiration in seconds.
	// When NodeMetrics expired, the node is considered abnormal, and should not be considered by deschedule plugin.
	// Default is 180 seconds.
	NodeMetricExpirationSeconds *int64

	// Naming this one differently since namespaces are still
	// considered while considering resoures used by pods
	// but then filtered out before eviction
	EvictableNamespaces *Namespaces

	// NodeSelector selects the nodes that matched labelSelector
	NodeSelector *metav1.LabelSelector

	// PodSelectors selects the pods that matched labelSelector
	PodSelectors []LowNodeLoadPodSelector

	// NodeFit if enabled, it will check whether the candidate Pods have suitable nodes, including NodeAffinity, TaintTolerance, and whether resources are sufficient.
	// by default, NodeFit is set to true.
	NodeFit bool

	// If UseDeviationThresholds is set to `true`, the thresholds are considered as percentage deviations from mean resource usage.
	// `LowThresholds` will be deducted from the mean among all nodes and `HighThresholds` will be added to the mean.
	// A resource consumption above (resp. below) this window is considered as overutilization (resp. underutilization).
	UseDeviationThresholds bool

	// HighThresholds defines the target usage threshold of resources
	HighThresholds ResourceThresholds

	// LowThresholds defines the low usage threshold of resources
	LowThresholds ResourceThresholds

	// ResourceWeights indicates the weights of resources.
	// The weights of resources are both 1 by default.
	ResourceWeights map[corev1.ResourceName]int64

	// AnomalyCondition indicates the node load anomaly thresholds,
	// the default is 5 consecutive times exceeding HighThresholds,
	// it is determined that the node is abnormal, and the Pods need to be migrated to reduce the load.
	AnomalyCondition *LoadAnomalyCondition

	// DetectorCacheTimeout indicates the cache expiration time of nodeAnomalyDetectors, the default is 5 minutes
	DetectorCacheTimeout *metav1.Duration

	// NodePools supports multiple different types of batch nodes to configure different strategies
	NodePools []LowNodeLoadNodePool
}

func (*LowNodeLoadArgs) DeepCopy added in v1.1.0

func (in *LowNodeLoadArgs) DeepCopy() *LowNodeLoadArgs

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

func (*LowNodeLoadArgs) DeepCopyInto added in v1.1.0

func (in *LowNodeLoadArgs) DeepCopyInto(out *LowNodeLoadArgs)

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

func (*LowNodeLoadArgs) DeepCopyObject added in v1.1.0

func (in *LowNodeLoadArgs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LowNodeLoadNodePool added in v1.3.0

type LowNodeLoadNodePool struct {
	// Name represents the name of pool
	Name string
	// NodeSelector selects the nodes that matched labelSelector
	NodeSelector *metav1.LabelSelector
	// If UseDeviationThresholds is set to `true`, the thresholds are considered as percentage deviations from mean resource usage.
	// `LowThresholds` will be deducted from the mean among all nodes and `HighThresholds` will be added to the mean.
	// A resource consumption above (resp. below) this window is considered as overutilization (resp. underutilization).
	UseDeviationThresholds bool

	// HighThresholds defines the target usage threshold of resources
	HighThresholds ResourceThresholds

	// LowThresholds defines the low usage threshold of resources
	LowThresholds ResourceThresholds

	// ResourceWeights indicates the weights of resources.
	// The weights of resources are both 1 by default.
	ResourceWeights map[corev1.ResourceName]int64

	// AnomalyCondition indicates the node load anomaly thresholds,
	// the default is 5 consecutive times exceeding HighThresholds,
	// it is determined that the node is abnormal, and the Pods need to be migrated to reduce the load.
	AnomalyCondition *LoadAnomalyCondition
}

func (*LowNodeLoadNodePool) DeepCopy added in v1.3.0

func (in *LowNodeLoadNodePool) DeepCopy() *LowNodeLoadNodePool

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

func (*LowNodeLoadNodePool) DeepCopyInto added in v1.3.0

func (in *LowNodeLoadNodePool) DeepCopyInto(out *LowNodeLoadNodePool)

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

type LowNodeLoadPodSelector added in v1.1.0

type LowNodeLoadPodSelector struct {
	Name string

	// Selector label query over pods for migrated
	Selector *metav1.LabelSelector
}

func (*LowNodeLoadPodSelector) DeepCopy added in v1.1.0

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

func (*LowNodeLoadPodSelector) DeepCopyInto added in v1.1.0

func (in *LowNodeLoadPodSelector) DeepCopyInto(out *LowNodeLoadPodSelector)

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

type MigrationControllerArgs

type MigrationControllerArgs struct {
	metav1.TypeMeta

	// DryRun means only execute the entire migration logic except create Reservation or Delete Pod
	// Default is false
	DryRun bool

	// MaxConcurrentReconciles is the maximum number of concurrent Reconciles which can be run. Defaults to 1.
	MaxConcurrentReconciles int32

	// EvictFailedBarePods allows pods without ownerReferences and in failed phase to be evicted.
	EvictFailedBarePods bool

	// EvictLocalStoragePods allows pods using local storage to be evicted.
	EvictLocalStoragePods bool

	// EvictSystemCriticalPods allows eviction of pods of any priority (including Kubernetes system pods)
	EvictSystemCriticalPods bool

	// IgnorePVCPods prevents pods with PVCs from being evicted.
	IgnorePvcPods bool

	// PriorityThreshold filtering only pods under the threshold can be evicted
	PriorityThreshold *PriorityThreshold

	// LabelSelector sets whether to apply label filtering when evicting.
	// Any pod matching the label selector is considered evictable.
	LabelSelector *metav1.LabelSelector

	// Namespaces carries a list of included/excluded namespaces
	Namespaces *Namespaces

	// NodeFit if enabled, it will check whether the candidate Pods have suitable nodes,
	// including NodeAffinity, TaintTolerance, and whether resources are sufficient.
	NodeFit bool

	// NodeSelector for a set of nodes to operate over
	NodeSelector string

	// MaxMigratingPerNode represents he maximum number of pods that can be migrating during migrate per node.
	MaxMigratingPerNode *int32

	// MaxMigratingPerNamespace represents he maximum number of pods that can be migrating during migrate per namespace.
	MaxMigratingPerNamespace *int32

	// MaxMigratingPerWorkload represents he maximum number of pods that can be migrating during migrate per workload.
	// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
	MaxMigratingPerWorkload *intstr.IntOrString

	// MaxUnavailablePerWorkload represents he maximum number of pods that can be unavailable during migrate per workload.
	// The unavailable state includes NotRunning/NotReady/Migrating/Evicting
	// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
	MaxUnavailablePerWorkload *intstr.IntOrString

	// SkipCheckExpectedReplicas if enabled, it will allow eviction expectedReplicas equals maxUnavailable or maxMigrating.
	// Default is false
	SkipCheckExpectedReplicas *bool

	// ObjectLimiters control the frequency of migration/eviction to make it smoother,
	// and also protect Pods of the same class from being evicted frequently.
	// e.g. limiting the frequency of Pods of the same workload being evicted.
	// The default is to set the MigrationLimitObjectWorkload limiter.
	ObjectLimiters ObjectLimiterMap

	// DefaultJobMode represents the default operating mode of the PodMigrationJob
	// Default is PodMigrationJobModeReservationFirst
	DefaultJobMode string

	// DefaultJobTTL represents the default TTL of the PodMigrationJob
	// Default is 5 minute
	DefaultJobTTL metav1.Duration

	// EvictQPS controls the number of evict per second
	EvictQPS *Float64OrString
	// EvictBurst is the maximum number of tokens
	EvictBurst int32
	// EvictionPolicy represents how to delete Pod, support "Delete" and "Eviction" and "SoftEviction", default value is "Eviction"
	EvictionPolicy string
	// DefaultDeleteOptions defines options when deleting migrated pods and preempted pods through the method specified by EvictionPolicy
	DefaultDeleteOptions *metav1.DeleteOptions

	// SchedulerNames defines options to assign schedulers that can handle reservation if pmj.mode is ReservationFirst, koord-scheduler by default.
	SchedulerNames []string

	// ArbitrationArgs defines the control parameters of the Arbitration Mechanism.
	ArbitrationArgs *ArbitrationArgs
}

MigrationControllerArgs holds arguments used to configure the MigrationController

func (*MigrationControllerArgs) DeepCopy

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

func (*MigrationControllerArgs) DeepCopyInto

func (in *MigrationControllerArgs) DeepCopyInto(out *MigrationControllerArgs)

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

func (*MigrationControllerArgs) DeepCopyObject

func (in *MigrationControllerArgs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MigrationLimitObjectType added in v1.1.1

type MigrationLimitObjectType string
const (
	MigrationLimitObjectWorkload MigrationLimitObjectType = "workload"
)

type MigrationObjectLimiter added in v1.1.1

type MigrationObjectLimiter struct {
	// Duration indicates the time window of the desired limit.
	Duration metav1.Duration
	// MaxMigrating indicates the maximum number of migrations/evictions allowed within the window time.
	// If configured as nil or 0, the maximum number will be calculated according to MaxMigratingPerWorkload.
	MaxMigrating *intstr.IntOrString
}

MigrationObjectLimiter means that if the specified dimension has multiple migrations within the configured time period and exceeds the configured threshold, it will be limited.

func (*MigrationObjectLimiter) DeepCopy added in v1.1.1

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

func (*MigrationObjectLimiter) DeepCopyInto added in v1.1.1

func (in *MigrationObjectLimiter) DeepCopyInto(out *MigrationObjectLimiter)

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

type Namespaces

type Namespaces struct {
	Include []string
	Exclude []string
}

Namespaces carries a list of included/excluded namespaces for which a given strategy is applicable

func (*Namespaces) DeepCopy

func (in *Namespaces) DeepCopy() *Namespaces

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

func (*Namespaces) DeepCopyInto

func (in *Namespaces) DeepCopyInto(out *Namespaces)

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

type ObjectLimiterMap added in v1.1.1

func (ObjectLimiterMap) DeepCopy added in v1.1.1

func (in ObjectLimiterMap) DeepCopy() ObjectLimiterMap

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

func (ObjectLimiterMap) DeepCopyInto added in v1.1.1

func (in ObjectLimiterMap) DeepCopyInto(out *ObjectLimiterMap)

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

type Percentage added in v1.1.0

type Percentage float64

type Plugin

type Plugin struct {
	// Name defines the name of plugin
	Name string
}

func (*Plugin) DeepCopy

func (in *Plugin) DeepCopy() *Plugin

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

func (*Plugin) DeepCopyInto

func (in *Plugin) DeepCopyInto(out *Plugin)

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

type PluginConfig

type PluginConfig struct {
	Name string
	Args runtime.Object
}

func (*PluginConfig) DeepCopy

func (in *PluginConfig) DeepCopy() *PluginConfig

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

func (*PluginConfig) DeepCopyInto

func (in *PluginConfig) DeepCopyInto(out *PluginConfig)

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

type PluginSet

type PluginSet struct {
	Enabled  []Plugin
	Disabled []Plugin
}

func (*PluginSet) DeepCopy

func (in *PluginSet) DeepCopy() *PluginSet

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

func (*PluginSet) DeepCopyInto

func (in *PluginSet) DeepCopyInto(out *PluginSet)

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

type Plugins

type Plugins struct {
	Deschedule PluginSet
	Balance    PluginSet
	Evict      PluginSet
	Filter     PluginSet
}

func (*Plugins) DeepCopy

func (in *Plugins) DeepCopy() *Plugins

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

func (*Plugins) DeepCopyInto

func (in *Plugins) DeepCopyInto(out *Plugins)

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

type PriorityThreshold

type PriorityThreshold struct {
	Value *int32
	Name  string
}

func (*PriorityThreshold) DeepCopy

func (in *PriorityThreshold) DeepCopy() *PriorityThreshold

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

func (*PriorityThreshold) DeepCopyInto

func (in *PriorityThreshold) DeepCopyInto(out *PriorityThreshold)

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

type ResourceThresholds added in v1.1.0

type ResourceThresholds map[corev1.ResourceName]Percentage

func (ResourceThresholds) DeepCopy added in v1.1.0

func (in ResourceThresholds) DeepCopy() ResourceThresholds

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

func (ResourceThresholds) DeepCopyInto added in v1.1.0

func (in ResourceThresholds) DeepCopyInto(out *ResourceThresholds)

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

type Type added in v1.2.0

type Type int64

Type represents the stored type of Float64OrString.

const (
	Float  Type = iota // The Float64OrString holds a Float.
	String             // The Float64OrString holds a string.
)

Directories

Path Synopsis
Package v1alpha2 is the v1alpha2 version of the descheduler API
Package v1alpha2 is the v1alpha2 version of the descheduler API

Jump to

Keyboard shortcuts

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