cluster

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterAutoScalerSafeEvict    = "cluster-autoscaler.kubernetes.io/safe-to-evict"
	KubecostTurnDownReplicas      = "kubecost.kubernetes.io/turn-down-replicas"
	KubecostTurnDownRollout       = "kubecost.kubernetes.io/turn-down-rollout"
	KubecostTurnDownSafeEvictFlag = "kubecost.kubernetes.io/safe-evict"
	KubecostTurnDownJobSuspend    = "kubecost.kubernetes.io/job-suspend"
)

Variables

This section is empty.

Functions

func IsEvictionAvailable

func IsEvictionAvailable(client kubernetes.Interface) (string, error)

Determine whether or not eviction is available. If so, return the policy group version

Types

type Draininator

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

Draininator is the type used to drain a specific kubernetes node. Much like the "drain" functionality provided by kubectl, this implementation will cordon the node, then aggressively force pod evictions, ignoring daemonset pods, and also evicting pods with local storage attached.

func NewDraininator

func NewDraininator(client kubernetes.Interface, node string, ignorePods []string) *Draininator

Creates a new Draininator instance for a specific node.

func (*Draininator) CordonNode

func (d *Draininator) CordonNode() error

func (*Draininator) DeletePodsOnNode

func (d *Draininator) DeletePodsOnNode() error

Deletes or evicts the pods on the node that qualify for eviction

func (*Draininator) Drain

func (d *Draininator) Drain() error

Cordons the node, then evicts pods from the node that qualify.

type Flattener

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

Flattener is the type used to set specific kubernetes annotations and configurations\ to entice the autoscaler to downscale the cluster.

func NewFlattener

func NewFlattener(client kubernetes.Interface, omitDeployments []string) *Flattener

Creates a new Draininator instance for a specific node.

func (*Flattener) Expand

func (d *Flattener) Expand() error

func (*Flattener) ExpandDaemonSet

func (d *Flattener) ExpandDaemonSet(ds appsv1.DaemonSet) error

func (*Flattener) ExpandDaemonSets

func (d *Flattener) ExpandDaemonSets() error

func (*Flattener) ExpandDeployment

func (d *Flattener) ExpandDeployment(dep appsv1.Deployment) error

func (*Flattener) ExpandDeployments

func (d *Flattener) ExpandDeployments() error

func (*Flattener) Flatten

func (d *Flattener) Flatten() error

Flatten reduces deployments to single replicas, updates rollout strategies and pod disruption budgets to one, and sets all pods to "safe for eviction". This mode is used to reduce node resources such that the autoscaler will reduce node counts on a cluster as low as possible.

func (*Flattener) FlattenDaemonSet

func (d *Flattener) FlattenDaemonSet(ds appsv1.DaemonSet) error

func (*Flattener) FlattenDaemonSets

func (d *Flattener) FlattenDaemonSets() error

func (*Flattener) FlattenDeployment

func (d *Flattener) FlattenDeployment(dep appsv1.Deployment) error

Flatten

func (*Flattener) FlattenDeployments

func (d *Flattener) FlattenDeployments() error

func (*Flattener) IsClusterFlattened

func (d *Flattener) IsClusterFlattened() bool

Test to determine if any of the cluster components have been flattened.

func (*Flattener) ResumeJob

func (d *Flattener) ResumeJob(cronJob v1b1.CronJob) error

Sets the deployment pods to a safe-evict state, updates annotation flags

func (*Flattener) ResumeJobs

func (d *Flattener) ResumeJobs() error

func (*Flattener) SuspendJob

func (d *Flattener) SuspendJob(cronJob v1b1.CronJob) error

func (*Flattener) SuspendJobs

func (d *Flattener) SuspendJobs() error

type PodFilter

type PodFilter func(v1.Pod) (bool, error)

PodFilter definition which is used to determine which pods to evict from a node.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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