Documentation ¶
Index ¶
- Constants
- func IsEvictionAvailable(client kubernetes.Interface) (string, error)
- type Draininator
- type Flattener
- func (d *Flattener) Expand() error
- func (d *Flattener) ExpandDaemonSet(ds appsv1.DaemonSet) error
- func (d *Flattener) ExpandDaemonSets() error
- func (d *Flattener) ExpandDeployment(dep appsv1.Deployment) error
- func (d *Flattener) ExpandDeployments() error
- func (d *Flattener) Flatten() error
- func (d *Flattener) FlattenDaemonSet(ds appsv1.DaemonSet) error
- func (d *Flattener) FlattenDaemonSets() error
- func (d *Flattener) FlattenDeployment(dep appsv1.Deployment) error
- func (d *Flattener) FlattenDeployments() error
- func (d *Flattener) IsClusterFlattened() bool
- func (d *Flattener) ResumeJob(cronJob v1b1.CronJob) error
- func (d *Flattener) ResumeJobs() error
- func (d *Flattener) SuspendJob(cronJob v1b1.CronJob) error
- func (d *Flattener) SuspendJobs() error
- type PodFilter
Constants ¶
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) ExpandDaemonSets ¶
func (*Flattener) ExpandDeployment ¶
func (d *Flattener) ExpandDeployment(dep appsv1.Deployment) error
func (*Flattener) ExpandDeployments ¶
func (*Flattener) Flatten ¶
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 (*Flattener) FlattenDaemonSets ¶
func (*Flattener) FlattenDeployment ¶
func (d *Flattener) FlattenDeployment(dep appsv1.Deployment) error
Flatten
func (*Flattener) FlattenDeployments ¶
func (*Flattener) IsClusterFlattened ¶
Test to determine if any of the cluster components have been flattened.
func (*Flattener) ResumeJob ¶
Sets the deployment pods to a safe-evict state, updates annotation flags