Documentation ¶
Index ¶
- Constants
- func GetPodEvictionCost(ctx context.Context, p *v1.Pod) float64
- type Action
- type Candidate
- type CandidateFilter
- type Command
- type Controller
- type Drift
- type Emptiness
- type EmptyNodeConsolidation
- func (c *EmptyNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error)
- func (c *EmptyNodeConsolidation) ConsolidationType() string
- func (c *EmptyNodeConsolidation) ShouldDisrupt(_ context.Context, cn *Candidate) bool
- func (c *EmptyNodeConsolidation) Type() string
- type Expiration
- type Method
- type MultiNodeConsolidation
- func (m *MultiNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error)
- func (m *MultiNodeConsolidation) ConsolidationType() string
- func (c *MultiNodeConsolidation) ShouldDisrupt(_ context.Context, cn *Candidate) bool
- func (m *MultiNodeConsolidation) Type() string
- type PDBLimits
- type SingleNodeConsolidation
- func (s *SingleNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error)
- func (s *SingleNodeConsolidation) ConsolidationType() string
- func (c *SingleNodeConsolidation) ShouldDisrupt(_ context.Context, cn *Candidate) bool
- func (s *SingleNodeConsolidation) Type() string
- type Validation
Constants ¶
const MultiNodeConsolidationTimeoutDuration = 1 * time.Minute
const SingleNodeConsolidationTimeoutDuration = 3 * time.Minute
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Candidate ¶
Candidate is a state.StateNode that we are considering for disruption along with extra information to be used in making that determination
func GetCandidates ¶
func GetCandidates(ctx context.Context, cluster *state.Cluster, kubeClient client.Client, recorder events.Recorder, clk clock.Clock, cloudProvider cloudprovider.CloudProvider, shouldDeprovision CandidateFilter, queue *orchestration.Queue) ([]*Candidate, error)
GetCandidates returns nodes that appear to be currently deprovisionable based off of their nodePool
func NewCandidate ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(clk clock.Clock, kubeClient client.Client, provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder, cluster *state.Cluster, queue *orchestration.Queue) *Controller
func (*Controller) Builder ¶
func (c *Controller) Builder(_ context.Context, m manager.Manager) controller.Builder
func (*Controller) Name ¶
func (c *Controller) Name() string
type Drift ¶
type Drift struct {
// contains filtered or unexported fields
}
Drift is a subreconciler that deletes drifted candidates.
func NewDrift ¶
func NewDrift(kubeClient client.Client, cluster *state.Cluster, provisioner *provisioning.Provisioner, recorder events.Recorder) *Drift
func (*Drift) ComputeCommand ¶
ComputeCommand generates a disruption command given candidates
func (*Drift) ConsolidationType ¶
func (*Drift) ShouldDisrupt ¶
ShouldDisrupt is a predicate used to filter candidates
type Emptiness ¶
type Emptiness struct {
// contains filtered or unexported fields
}
Emptiness is a subreconciler that deletes empty candidates. Emptiness will respect TTLSecondsAfterEmpty
func NewEmptiness ¶
func (*Emptiness) ComputeCommand ¶
ComputeCommand generates a disruption command given candidates
func (*Emptiness) ConsolidationType ¶
func (*Emptiness) ShouldDisrupt ¶
ShouldDisrupt is a predicate used to filter candidates
type EmptyNodeConsolidation ¶
type EmptyNodeConsolidation struct {
// contains filtered or unexported fields
}
EmptyNodeConsolidation is the consolidation controller that performs multi-nodeclaim consolidation of entirely empty nodes
func NewEmptyNodeConsolidation ¶
func NewEmptyNodeConsolidation(consolidation consolidation) *EmptyNodeConsolidation
func (*EmptyNodeConsolidation) ComputeCommand ¶
func (c *EmptyNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error)
ComputeCommand generates a disruption command given candidates
func (*EmptyNodeConsolidation) ConsolidationType ¶
func (c *EmptyNodeConsolidation) ConsolidationType() string
func (*EmptyNodeConsolidation) ShouldDisrupt ¶
ShouldDisrupt is a predicate used to filter candidates
func (*EmptyNodeConsolidation) Type ¶
func (c *EmptyNodeConsolidation) Type() string
type Expiration ¶
type Expiration struct {
// contains filtered or unexported fields
}
Expiration is a subreconciler that deletes empty candidates. Expiration will respect TTLSecondsAfterEmpty
func NewExpiration ¶
func NewExpiration(clk clock.Clock, kubeClient client.Client, cluster *state.Cluster, provisioner *provisioning.Provisioner, recorder events.Recorder) *Expiration
func (*Expiration) ComputeCommand ¶
ComputeCommand generates a disrpution command given candidates
func (*Expiration) ConsolidationType ¶
func (e *Expiration) ConsolidationType() string
func (*Expiration) ShouldDisrupt ¶
func (e *Expiration) ShouldDisrupt(_ context.Context, c *Candidate) bool
ShouldDisrupt is a predicate used to filter candidates
func (*Expiration) Type ¶
func (e *Expiration) Type() string
type MultiNodeConsolidation ¶
type MultiNodeConsolidation struct {
// contains filtered or unexported fields
}
func NewMultiNodeConsolidation ¶
func NewMultiNodeConsolidation(consolidation consolidation) *MultiNodeConsolidation
func (*MultiNodeConsolidation) ComputeCommand ¶
func (*MultiNodeConsolidation) ConsolidationType ¶
func (m *MultiNodeConsolidation) ConsolidationType() string
func (*MultiNodeConsolidation) ShouldDisrupt ¶
ShouldDisrupt is a predicate used to filter candidates
func (*MultiNodeConsolidation) Type ¶
func (m *MultiNodeConsolidation) Type() string
type PDBLimits ¶
type PDBLimits struct {
// contains filtered or unexported fields
}
PDBLimits is used to evaluate if evicting a list of pods is possible.
func NewPDBLimits ¶
type SingleNodeConsolidation ¶
type SingleNodeConsolidation struct {
// contains filtered or unexported fields
}
SingleNodeConsolidation is the consolidation controller that performs single-node consolidation.
func NewSingleNodeConsolidation ¶
func NewSingleNodeConsolidation(consolidation consolidation) *SingleNodeConsolidation
func (*SingleNodeConsolidation) ComputeCommand ¶
func (s *SingleNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...*Candidate) (Command, error)
ComputeCommand generates a disruption command given candidates nolint:gocyclo
func (*SingleNodeConsolidation) ConsolidationType ¶
func (s *SingleNodeConsolidation) ConsolidationType() string
func (*SingleNodeConsolidation) ShouldDisrupt ¶
ShouldDisrupt is a predicate used to filter candidates
func (*SingleNodeConsolidation) Type ¶
func (s *SingleNodeConsolidation) Type() string
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
Validation is used to perform validation on a consolidation command. It makes an assumption that when re-used, all of the commands passed to IsValid were constructed based off of the same consolidation state. This allows it to skip the validation TTL for all but the first command.
func NewValidation ¶
func NewValidation(validationPeriod time.Duration, clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder, queue *orchestration.Queue) *Validation
func (*Validation) ShouldDisrupt ¶
func (v *Validation) ShouldDisrupt(_ context.Context, c *Candidate) bool
ShouldDisrupt is a predicate used to filter candidates
func (*Validation) ValidateCommand ¶
func (v *Validation) ValidateCommand(ctx context.Context, cmd Command, candidates []*Candidate) (bool, error)
ValidateCommand validates a command for a Method