Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Controller ¶
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
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
Click to show internal directories.
Click to hide internal directories.