Documentation
¶
Index ¶
- func DecodeInto(obj runtime.Object, into interface{}) error
- func NewFramework(ctx context.Context, r Registry, profile *config.KubeSchedulerProfile, ...) (framework.Framework, error)
- func NewWaitingPodsMap() *waitingPodsMap
- type CaptureProfile
- type OpportunisticBatch
- type Option
- func WithAPIDispatcher(apiDispatcher *apidispatcher.APIDispatcher) Option
- func WithCaptureProfile(c CaptureProfile) Option
- func WithClientSet(clientSet clientset.Interface) Option
- func WithComponentConfigVersion(componentConfigVersion string) Option
- func WithEventRecorder(recorder events.EventRecorder) Option
- func WithExtenders(extenders []fwk.Extender) Option
- func WithInformerFactory(informerFactory informers.SharedInformerFactory) Option
- func WithKubeConfig(kubeConfig *restclient.Config) Option
- func WithLogger(logger klog.Logger) Option
- func WithMetricsRecorder(r *metrics.MetricAsyncRecorder) Option
- func WithParallelism(parallelism int) Option
- func WithPodActivator(activator fwk.PodActivator) Option
- func WithPodNominator(nominator fwk.PodNominator) Option
- func WithSharedCSIManager(sharedCSIManager fwk.CSIManager) Option
- func WithSharedDRAManager(sharedDRAManager fwk.SharedDRAManager) Option
- func WithSnapshotSharedLister(snapshotSharedLister fwk.SharedLister) Option
- func WithWaitingPods(wp *waitingPodsMap) Option
- func WithWorkloadManager(workloadManager fwk.WorkloadManager) Option
- type PluginFactory
- type PluginFactoryWithFts
- type Registry
- type SignatureFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeInto ¶
DecodeInto decodes configuration whose type is *runtime.Unknown to the interface into.
func NewFramework ¶
func NewFramework(ctx context.Context, r Registry, profile *config.KubeSchedulerProfile, opts ...Option) (framework.Framework, error)
NewFramework initializes plugins given the configuration and the registry.
func NewWaitingPodsMap ¶ added in v1.31.0
func NewWaitingPodsMap() *waitingPodsMap
NewWaitingPodsMap returns a new waitingPodsMap.
Types ¶
type CaptureProfile ¶ added in v1.20.0
type CaptureProfile func(config.KubeSchedulerProfile)
CaptureProfile is a callback to capture a finalized profile.
type OpportunisticBatch ¶
type OpportunisticBatch struct {
// contains filtered or unexported fields
}
OpportunisticBatching caches results from filtering and scoring when possible to optimize scheduling of common pods.
func (*OpportunisticBatch) GetNodeHint ¶
func (b *OpportunisticBatch) GetNodeHint(ctx context.Context, pod *v1.Pod, state fwk.CycleState, cycleCount int64) (string, fwk.PodSignature)
Provide a hint for the pod based on filtering an scoring results of previous cycles. Caching works only for consecutive pods with the same signature that are scheduled in 1-pod-per-node manner (otherwise previous scores could not be reused). It's assured by checking the top rated node is no longer feasible (meaning the previous pod was successfully scheduled and the current one does not fit).
func (*OpportunisticBatch) StoreScheduleResults ¶
func (b *OpportunisticBatch) StoreScheduleResults(ctx context.Context, signature fwk.PodSignature, hintedNode, chosenNode string, otherNodes framework.SortedScoredNodes, cycleCount int64)
Store results from scheduling for use as a batch later.
type Option ¶
type Option func(*frameworkOptions)
Option for the frameworkImpl.
func WithAPIDispatcher ¶ added in v1.34.0
func WithAPIDispatcher(apiDispatcher *apidispatcher.APIDispatcher) Option
WithAPIDispatcher sets API dispatcher for the scheduling frameworkImpl.
func WithCaptureProfile ¶ added in v1.20.0
func WithCaptureProfile(c CaptureProfile) Option
WithCaptureProfile sets a callback to capture the finalized profile.
func WithClientSet ¶
WithClientSet sets clientSet for the scheduling frameworkImpl.
func WithComponentConfigVersion ¶ added in v1.22.0
WithComponentConfigVersion sets the component config version to the KubeSchedulerConfiguration version used. The string should be the full scheme group/version of the external type we converted from (for example "kubescheduler.config.k8s.io/v1")
func WithEventRecorder ¶
func WithEventRecorder(recorder events.EventRecorder) Option
WithEventRecorder sets clientSet for the scheduling frameworkImpl.
func WithExtenders ¶
WithExtenders sets extenders for the scheduling frameworkImpl.
func WithInformerFactory ¶
func WithInformerFactory(informerFactory informers.SharedInformerFactory) Option
WithInformerFactory sets informer factory for the scheduling frameworkImpl.
func WithKubeConfig ¶ added in v1.22.0
func WithKubeConfig(kubeConfig *restclient.Config) Option
WithKubeConfig sets kubeConfig for the scheduling frameworkImpl.
func WithLogger ¶ added in v1.28.0
func WithLogger(logger klog.Logger) Option
WithLogger overrides the default logger from k8s.io/klog.
func WithMetricsRecorder ¶ added in v1.27.0
func WithMetricsRecorder(r *metrics.MetricAsyncRecorder) Option
WithMetricsRecorder sets metrics recorder for the scheduling frameworkImpl.
func WithParallelism ¶ added in v1.21.0
WithParallelism sets parallelism for the scheduling frameworkImpl.
func WithPodActivator ¶ added in v1.32.0
func WithPodActivator(activator fwk.PodActivator) Option
func WithPodNominator ¶
func WithPodNominator(nominator fwk.PodNominator) Option
WithPodNominator sets podNominator for the scheduling frameworkImpl.
func WithSharedCSIManager ¶
func WithSharedCSIManager(sharedCSIManager fwk.CSIManager) Option
WithSharedCSIManager sets SharedCSIManager for the framework.
func WithSharedDRAManager ¶ added in v1.32.0
func WithSharedDRAManager(sharedDRAManager fwk.SharedDRAManager) Option
WithSharedDRAManager sets SharedDRAManager for the framework.
func WithSnapshotSharedLister ¶
func WithSnapshotSharedLister(snapshotSharedLister fwk.SharedLister) Option
WithSnapshotSharedLister sets the SharedLister of the snapshot.
func WithWaitingPods ¶ added in v1.31.0
func WithWaitingPods(wp *waitingPodsMap) Option
WithWaitingPods sets waitingPods for the scheduling frameworkImpl.
func WithWorkloadManager ¶
func WithWorkloadManager(workloadManager fwk.WorkloadManager) Option
WithWorkloadManager sets Workload manager for the scheduling frameworkImpl.
type PluginFactory ¶
type PluginFactory = func(ctx context.Context, configuration runtime.Object, f fwk.Handle) (fwk.Plugin, error)
PluginFactory is a function that builds a plugin.
func FactoryAdapter ¶ added in v1.23.0
func FactoryAdapter[T fwk.Plugin](fts plfeature.Features, withFts PluginFactoryWithFts[T]) PluginFactory
FactoryAdapter can be used to inject feature gates for a plugin that needs them when the caller expects the older PluginFactory method.
type PluginFactoryWithFts ¶ added in v1.23.0
type PluginFactoryWithFts[T fwk.Plugin] func(context.Context, runtime.Object, fwk.Handle, plfeature.Features) (T, error)
PluginFactoryWithFts is a function that builds a plugin with certain feature gates.
type Registry ¶
type Registry map[string]PluginFactory
Registry is a collection of all available plugins. The framework uses a registry to enable and initialize configured plugins. All plugins must be in the registry before initializing the framework.
func (Registry) Register ¶
func (r Registry) Register(name string, factory PluginFactory) error
Register adds a new plugin to the registry. If a plugin with the same name exists, it returns an error.
func (Registry) Unregister ¶
Unregister removes an existing plugin from the registry. If no plugin with the provided name exists, it returns an error.