Documentation ¶
Index ¶
- func GetPodEvictionCost(ctx context.Context, p *v1.Pod) float64
- type CandidateFilter
- type CandidateNode
- type Command
- type Controller
- type Deprovisioner
- type Drift
- type Emptiness
- type EmptyNodeConsolidation
- func (c *EmptyNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
- func (c *EmptyNodeConsolidation) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, ...) bool
- func (c *EmptyNodeConsolidation) String() string
- func (c *EmptyNodeConsolidation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
- type Expiration
- func (e *Expiration) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
- func (e *Expiration) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, ...) bool
- func (e *Expiration) SortCandidates(nodes []CandidateNode) []CandidateNode
- func (e *Expiration) String() string
- type MultiNodeConsolidation
- func (m *MultiNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
- func (c *MultiNodeConsolidation) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, ...) bool
- func (c *MultiNodeConsolidation) String() string
- func (c *MultiNodeConsolidation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
- type PDBLimits
- type SingleNodeConsolidation
- func (c *SingleNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
- func (c *SingleNodeConsolidation) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, ...) bool
- func (c *SingleNodeConsolidation) String() string
- func (c *SingleNodeConsolidation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
- type Validation
- func (v *Validation) IsValid(ctx context.Context, cmd Command) (bool, error)
- func (v *Validation) ShouldDeprovision(_ context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, ...) bool
- func (v *Validation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CandidateFilter ¶
type CandidateNode ¶
CandidateNode is a node that we are considering for deprovisioning along with extra information to be used in making that determination
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the deprovisioning controller.
func NewController ¶
func NewController(clk clock.Clock, kubeClient client.Client, provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder, cluster *state.Cluster) *Controller
func (*Controller) Builder ¶
func (c *Controller) Builder(_ context.Context, m manager.Manager) controller.Builder
func (*Controller) Name ¶
func (c *Controller) Name() string
type Deprovisioner ¶
type Drift ¶
type Drift struct {
// contains filtered or unexported fields
}
Drift is a subreconciler that deletes empty nodes. Drift will respect TTLSecondsAfterEmpty
func NewDrift ¶
func NewDrift(kubeClient client.Client, cluster *state.Cluster, provisioner *provisioning.Provisioner, recorder events.Recorder) *Drift
func (*Drift) ComputeCommand ¶
ComputeCommand generates a deprovisioning command given deprovisionable nodes
type Emptiness ¶
type Emptiness struct {
// contains filtered or unexported fields
}
Emptiness is a subreconciler that deletes empty nodes. Emptiness will respect TTLSecondsAfterEmpty
func NewEmptiness ¶
func (*Emptiness) ComputeCommand ¶
ComputeCommand generates a deprovisioning command given deprovisionable nodes
type EmptyNodeConsolidation ¶
type EmptyNodeConsolidation struct {
// contains filtered or unexported fields
}
EmptyNodeConsolidation is the consolidation controller that performs multi-node consolidation of entirely empty nodes
func NewEmptyNodeConsolidation ¶
func NewEmptyNodeConsolidation(clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder) *EmptyNodeConsolidation
func (*EmptyNodeConsolidation) ComputeCommand ¶
func (c *EmptyNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
ComputeCommand generates a deprovisioning command given deprovisionable nodes
func (*EmptyNodeConsolidation) ShouldDeprovision ¶
func (c *EmptyNodeConsolidation) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, _ []*v1.Pod) bool
ShouldDeprovision is a predicate used to filter deprovisionable nodes
func (*EmptyNodeConsolidation) String ¶
func (c *EmptyNodeConsolidation) String() string
string is the string representation of the deprovisioner
func (*EmptyNodeConsolidation) ValidateCommand ¶
func (c *EmptyNodeConsolidation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
ValidateCommand validates a command for a deprovisioner
type Expiration ¶
type Expiration struct {
// contains filtered or unexported fields
}
Expiration is a subreconciler that deletes empty nodes. 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 ¶
func (e *Expiration) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
ComputeCommand generates a deprovisioning command given deprovisionable nodes
func (*Expiration) ShouldDeprovision ¶
func (e *Expiration) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, nodePods []*v1.Pod) bool
ShouldDeprovision is a predicate used to filter deprovisionable nodes
func (*Expiration) SortCandidates ¶
func (e *Expiration) SortCandidates(nodes []CandidateNode) []CandidateNode
SortCandidates orders expired nodes by when they've expired
func (*Expiration) String ¶
func (e *Expiration) String() string
String is the string representation of the deprovisioner
type MultiNodeConsolidation ¶
type MultiNodeConsolidation struct {
// contains filtered or unexported fields
}
func NewMultiNodeConsolidation ¶
func NewMultiNodeConsolidation(clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder) *MultiNodeConsolidation
func (*MultiNodeConsolidation) ComputeCommand ¶
func (m *MultiNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
func (*MultiNodeConsolidation) ShouldDeprovision ¶
func (c *MultiNodeConsolidation) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, _ []*v1.Pod) bool
ShouldDeprovision is a predicate used to filter deprovisionable nodes
func (*MultiNodeConsolidation) String ¶
func (c *MultiNodeConsolidation) String() string
string is the string representation of the deprovisioner
func (*MultiNodeConsolidation) ValidateCommand ¶
func (c *MultiNodeConsolidation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
ValidateCommand validates a command for a deprovisioner
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(clk clock.Clock, cluster *state.Cluster, kubeClient client.Client, provisioner *provisioning.Provisioner, cp cloudprovider.CloudProvider, recorder events.Recorder) *SingleNodeConsolidation
func (*SingleNodeConsolidation) ComputeCommand ¶
func (c *SingleNodeConsolidation) ComputeCommand(ctx context.Context, candidates ...CandidateNode) (Command, error)
ComputeCommand generates a deprovisioning command given deprovisionable nodes
func (*SingleNodeConsolidation) ShouldDeprovision ¶
func (c *SingleNodeConsolidation) ShouldDeprovision(ctx context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, _ []*v1.Pod) bool
ShouldDeprovision is a predicate used to filter deprovisionable nodes
func (*SingleNodeConsolidation) String ¶
func (c *SingleNodeConsolidation) String() string
string is the string representation of the deprovisioner
func (*SingleNodeConsolidation) ValidateCommand ¶
func (c *SingleNodeConsolidation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
ValidateCommand validates a command for a deprovisioner
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) *Validation
func (*Validation) ShouldDeprovision ¶
func (v *Validation) ShouldDeprovision(_ context.Context, n *state.Node, provisioner *v1alpha5.Provisioner, _ []*v1.Pod) bool
ShouldDeprovision is a predicate used to filter deprovisionable nodes
func (*Validation) ValidateCommand ¶
func (v *Validation) ValidateCommand(ctx context.Context, cmd Command, candidateNodes []CandidateNode) (bool, error)
ValidateCommand validates a command for a deprovisioner