deschedule

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package deschedule provides the deschedule strategy. Violation conditions and enforcement behavior are defined here. When a node is violating the deschedule strategy, the enforcer labels it as violating. This label can then be used externally to act on the strategy violation.

Index

Constants

View Source
const (
	StrategyType = "deschedule"
)

StrategyType is set to de-schedule.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strategy

type Strategy telempol.TASPolicyStrategy

Strategy type for de-scheduling from a single policy.

func (*Strategy) Cleanup

func (d *Strategy) Cleanup(enforcer *strategy.MetricEnforcer, policyName string) error

Cleanup remove node labels for violating when policy is deleted.

func (*Strategy) Enforce

func (d *Strategy) Enforce(enforcer *strategy.MetricEnforcer, cache cache.Reader) (int, error)

Enforce describes the behavior followed by this strategy to return associated pods to non-violating status. For descheduling enforcement is done by labelling the nodes as violators. This label can then be used externally, for example by descheduler, to remedy the situation. Here we make an api call to list all nodes first. This may be improved by using a controller instead or some other way of not waiting for the API call every time Enforce is called.

func (*Strategy) Equals

func (d *Strategy) Equals(other core.Interface) bool

Equals checks if a strategy is the same as the passed strategy. It can be used to prevent duplication of strategies in the API and is also used to find strategies for deletion. TODO: Remedial action if equal, i.e. point to other strategies. Make method order ambivalent.

func (*Strategy) GetPolicyName

func (d *Strategy) GetPolicyName() string

GetPolicyName returns the name of the policy that originated strategy.

func (*Strategy) SetPolicyName

func (d *Strategy) SetPolicyName(name string)

SetPolicyName adds a policy name to be associated with this strategy.

func (*Strategy) StrategyType

func (d *Strategy) StrategyType() string

StrategyType returns the name of the strategy type. This is used to place it in the registry.

func (*Strategy) Violated

func (d *Strategy) Violated(cache cache.Reader) map[string]interface{}

Violated checks to see if the strategy is violated by searching for nodes that have metrics that don't accord with the target in descheduling strategy. Returns a map of nodeNames as key with an empty value associated with each.

Jump to

Keyboard shortcuts

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