deletiontracker

package
v0.0.0-...-29ce5d4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeDeletionTracker

type NodeDeletionTracker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

NodeDeletionTracker keeps track of node deletions.

func NewNodeDeletionTracker

func NewNodeDeletionTracker(podEvictionsTTL time.Duration) *NodeDeletionTracker

NewNodeDeletionTracker creates new NodeDeletionTracker.

func (*NodeDeletionTracker) ClearResultsNotNewerThan

func (n *NodeDeletionTracker) ClearResultsNotNewerThan(t time.Time)

ClearResultsNotNewerThan iterates over existing deletion results and keeps only the ones that are newer than the provided timestamp.

func (*NodeDeletionTracker) DeletionResults

func (n *NodeDeletionTracker) DeletionResults() (map[string]status.NodeDeleteResult, time.Time)

DeletionResults returns deletion results since the last ClearResultsNotNewerThan call in a map form, along with the timestamp of last result.

func (*NodeDeletionTracker) DeletionsCount

func (n *NodeDeletionTracker) DeletionsCount(nodeGroupId string) int

DeletionsCount returns the number of deletions in progress for the given node group.

func (*NodeDeletionTracker) DeletionsInProgress

func (n *NodeDeletionTracker) DeletionsInProgress() ([]string, []string)

DeletionsInProgress returns a list of all node names currently undergoing deletion.

func (*NodeDeletionTracker) EndDeletion

func (n *NodeDeletionTracker) EndDeletion(nodeGroupId, nodeName string, result status.NodeDeleteResult)

EndDeletion decrements node deletion in progress counter for the given nodegroup.

func (*NodeDeletionTracker) RecentEvictions

func (n *NodeDeletionTracker) RecentEvictions() []*apiv1.Pod

RecentEvictions returns a list of pods that were recently evicted by Cluster Autoscaler.

func (*NodeDeletionTracker) RegisterEviction

func (n *NodeDeletionTracker) RegisterEviction(pod *apiv1.Pod)

RegisterEviction stores information about a pod that was recently evicted.

func (*NodeDeletionTracker) Snapshot

Snapshot return a copy of NodeDeletionTracker.

func (*NodeDeletionTracker) StartDeletion

func (n *NodeDeletionTracker) StartDeletion(nodeGroupId, nodeName string)

StartDeletion increments node deletion in progress counter for the given nodegroup.

func (*NodeDeletionTracker) StartDeletionWithDrain

func (n *NodeDeletionTracker) StartDeletionWithDrain(nodeGroupId, nodeName string)

StartDeletionWithDrain is equivalent to StartDeletion, but for counting nodes that are drained first.

Jump to

Keyboard shortcuts

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