pkg

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configset

func Configset() *rest.Config

Types

type Controller

type Controller interface {
	Run(ctx context.Context) error
}

func NewController

func NewController(opts Options) Controller

type Options

type Options struct {
	// DryRun=true won't evict Pods for real
	DryRun bool

	// PodSelector is the selector used to list pods, allowing inclusion or
	// exclusion of specific Pods.
	PodSelector SelectorFlag

	// MemoryUsageThreshold is the threshold (0-100) above which a Pod is considered
	// as overusing its memory.
	MemoryUsageThreshold int

	// EvictionPause is the delay we wait between two evictions, to prevent
	// removing too many Pods at once. Else we could more easily have downtimes if
	// Deployments don't specify a PodDisruptionBudget. Pods defining a
	// PodDisruptionBudget will ignore the pause, but respecting the budget.
	EvictionPause time.Duration

	// MemoryUsageCheckInterval is how often we check the memory usage.
	// It doesn't need to be too frequent, as we have to wait for the metric-server
	// to refresh the metrics all the time.
	MemoryUsageCheckInterval time.Duration

	// ChannelQueueSize is the size of the queue for Pods to evict.
	// It is filled each check interval and drained by the eviction loops. Eviction
	// pauses and backoffs cause the queue to fill up.
	ChannelQueueSize int

	// IgnoredNamespaces is a list of namespaces to ignore when checking Pods.
	IgnoredNamespaces cli.StringSlice

	// EnableMetrics toggles the Prometheus exporter.
	EnableMetrics bool

	// MetricsBindAddress is the bind address for the Prometheus exporter
	// (for example, ":9288").
	MetricsBindAddress string
}

type PodMetricsInterfaceList

type PodMetricsInterfaceList interface {
	List(ctx context.Context, opts metav1.ListOptions) (*metricsv1beta1.PodMetricsList, error)
}

type SelectorFlag added in v0.2.0

type SelectorFlag struct {
	Selector labels.Selector
}

func (*SelectorFlag) Set added in v0.2.0

func (selectorFlag *SelectorFlag) Set(value string) error

func (*SelectorFlag) String added in v0.2.0

func (selectorFlag *SelectorFlag) String() string

Jump to

Keyboard shortcuts

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