consolidation

package
v0.17.0-test13 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPodEvictionCost

func GetPodEvictionCost(ctx context.Context, p *v1.Pod) float64

GetPodEvictionCost returns the disruption cost computed for evicting the given pod.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the consolidation controller. It is not a standard controller-runtime controller in that it doesn't have a reconcile method.

func NewController

func NewController(ctx context.Context, clk clock.Clock, kubeClient client.Client, provisioner *provisioning.Provisioner,
	cp cloudprovider.CloudProvider, recorder events.Recorder, cluster *state.Cluster, startAsync <-chan struct{}) *Controller

func (*Controller) ProcessCluster

func (c *Controller) ProcessCluster(ctx context.Context) (ProcessResult, error)

ProcessCluster is exposed for unit testing purposes

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

func NewPDBLimits(ctx context.Context, kubeClient client.Client) (*PDBLimits, error)

func (*PDBLimits) CanEvictPods

func (s *PDBLimits) CanEvictPods(pods []*v1.Pod) bool

CanEvictPods returns true if every pod in the list is evictable. They may not all be evictable simultaneously, but for every PDB that controls the pods at least one pod can be evicted.

type ProcessResult

type ProcessResult byte

ProcessResult is used to indicate the result of consolidating so we can optimize by not trying to consolidate if we were unable to consolidate the cluster and it hasn't changed state with respect to pods/nodes.

const (
	ProcessResultNothingToDo ProcessResult = iota
	ProcessResultFailed
	ProcessResultConsolidated
)

Jump to

Keyboard shortcuts

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