monitor

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SpotITNKind is a const to define a Spot ITN kind of interruption event
	SpotITNKind = "SPOT_ITN"
	// ScheduledEventKind is a const to define a scheduled event kind of interruption event
	ScheduledEventKind = "SCHEDULED_EVENT"
	// RebalanceRecommendationKind is a const to define a Rebalance Recommendation kind of interruption event
	RebalanceRecommendationKind = "REBALANCE_RECOMMENDATION"
	// StateChangeKind is a const to define an EC2 State Change kind of interruption event
	StateChangeKind = "STATE_CHANGE"
	// ASGLifecycleKind is a const to define an ASG Lifecycle kind of interruption event
	ASGLifecycleKind = "ASG_LIFECYCLE"
	// ASGLifecycleKind is a const to define an ASG Launch Lifecycle kind of interruption event
	ASGLaunchLifecycleKind = "ASG_LAUNCH_LIFECYCLE"
	// SQSTerminateKind is a const to define an SQS termination kind of interruption event
	SQSTerminateKind = "SQS_TERMINATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DrainTask

type DrainTask func(InterruptionEvent, node.Node) error

DrainTask defines a task to be run when draining a node

type InterruptionEvent

type InterruptionEvent struct {
	EventID              string
	Kind                 string
	Monitor              string
	Description          string
	State                string
	AutoScalingGroupName string
	NodeName             string
	NodeLabels           map[string]string
	Pods                 []string
	InstanceID           string
	ProviderID           string
	IsManaged            bool
	StartTime            time.Time
	EndTime              time.Time
	NodeProcessed        bool
	InProgress           bool
	PreDrainTask         DrainTask `json:"-"`
	PostDrainTask        DrainTask `json:"-"`
}

InterruptionEvent gives more context of the interruption event

func (*InterruptionEvent) IsRebalanceRecommendation added in v1.10.0

func (e *InterruptionEvent) IsRebalanceRecommendation() bool

IsRebalanceRecommendation returns true if the interruption event is a rebalance recommendation

func (*InterruptionEvent) TimeUntilEvent

func (e *InterruptionEvent) TimeUntilEvent() time.Duration

TimeUntilEvent returns the duration until the event start time

type Monitor

type Monitor interface {
	Monitor() error
	Kind() string
}

Monitor is an interface which can be implemented for various sources of interruption events

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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