framework

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EvictionPluginNameContextKey = pointer.String("pluginName")
	EvictionReasonContextKey     = pointer.String("evictionReason")
)

Functions

func FillEvictOptionsFromContext added in v1.1.1

func FillEvictOptionsFromContext(ctx context.Context, options *EvictOptions)

func PluginNameWithContext added in v1.1.1

func PluginNameWithContext(ctx context.Context, pluginName string) context.Context

Types

type BalancePlugin

type BalancePlugin interface {
	Plugin
	Balance(ctx context.Context, nodes []*corev1.Node) *Status
}

type DeschedulePlugin

type DeschedulePlugin interface {
	Plugin
	Deschedule(ctx context.Context, nodes []*corev1.Node) *Status
}

type EvictOptions

type EvictOptions struct {
	// PluginName represents the initiator of the eviction operation
	PluginName string
	// Reason allows for passing details about the specific eviction for logging.
	Reason string
	// DeleteOptions holds the arguments used to delete
	DeleteOptions *metav1.DeleteOptions
}

EvictOptions provides a handle for passing additional info to EvictPod

type EvictPlugin added in v1.2.0

type EvictPlugin interface {
	Plugin
	// Evict evicts a pod (no pre-check performed)
	Evict(ctx context.Context, pod *corev1.Pod, evictOptions EvictOptions) bool
}

type Evictor

type Evictor interface {
	// Filter checks if a pod can be evicted
	Filter(pod *corev1.Pod) bool
	// PreEvictionFilter checks if pod can be evicted right before eviction
	PreEvictionFilter(pod *corev1.Pod) bool
	// Evict evicts a pod (no pre-check performed)
	Evict(ctx context.Context, pod *corev1.Pod, evictOptions EvictOptions) bool
}

type FilterFunc

type FilterFunc func(*corev1.Pod) bool

FilterFunc is a filter for a pod.

type FilterPlugin added in v1.2.0

type FilterPlugin interface {
	Plugin
	// Filter checks if a pod can be evicted
	Filter(pod *corev1.Pod) bool
	// PreEvictionFilter checks if pod can be evicted right before eviction
	PreEvictionFilter(pod *corev1.Pod) bool
}

type GetPodsAssignedToNodeFunc

type GetPodsAssignedToNodeFunc func(string, FilterFunc) ([]*corev1.Pod, error)

GetPodsAssignedToNodeFunc is a function which accept a node name and a pod filter function as input and returns the pods that assigned to the node.

type Handle

type Handle interface {
	PluginsRunner
	// ClientSet returns a kubernetes clientSet.
	ClientSet() clientset.Interface

	// KubeConfig returns the raw kube config.
	KubeConfig() *restclient.Config

	// EventRecorder returns an event recorder.
	EventRecorder() events.EventRecorder

	Evictor() Evictor

	GetPodsAssignedToNodeFunc() GetPodsAssignedToNodeFunc

	SharedInformerFactory() informers.SharedInformerFactory
}

type Plugin

type Plugin interface {
	Name() string
}

Plugin is the parent type for all the descheduling framework plugins.

type PluginsRunner

type PluginsRunner interface {
	RunDeschedulePlugins(ctx context.Context, nodes []*corev1.Node) *Status
	RunBalancePlugins(ctx context.Context, nodes []*corev1.Node) *Status
}

type Status

type Status struct {
	Err error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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