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
- type Strategy
- func (d *Strategy) Cleanup(enforcer *strategy.MetricEnforcer, policyName string) error
- func (d *Strategy) Enforce(enforcer *strategy.MetricEnforcer, cache cache.Reader) (int, error)
- func (d *Strategy) Equals(other core.Interface) bool
- func (d *Strategy) GetPolicyName() string
- func (d *Strategy) SetPolicyName(name string)
- func (d *Strategy) StrategyType() string
- func (d *Strategy) Violated(cache cache.Reader) map[string]interface{}
Constants ¶
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 ¶
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 ¶
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 ¶
GetPolicyName returns the name of the policy that originated strategy.
func (*Strategy) SetPolicyName ¶
SetPolicyName adds a policy name to be associated with this strategy.
func (*Strategy) StrategyType ¶
StrategyType returns the name of the strategy type. This is used to place it in the registry.