interruption

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReceivedMessages = opmetrics.NewPrometheusCounter(
		crmetrics.Registry,
		prometheus.CounterOpts{
			Namespace: metrics.Namespace,
			Subsystem: interruptionSubsystem,
			Name:      "received_messages_total",
			Help:      "Count of messages received from the SQS queue. Broken down by message type and whether the message was actionable.",
		},
		[]string{messageTypeLabel},
	)
	DeletedMessages = opmetrics.NewPrometheusCounter(
		crmetrics.Registry,
		prometheus.CounterOpts{
			Namespace: metrics.Namespace,
			Subsystem: interruptionSubsystem,
			Name:      "deleted_messages_total",
			Help:      "Count of messages deleted from the SQS queue.",
		},
		[]string{},
	)
	MessageLatency = opmetrics.NewPrometheusHistogram(
		crmetrics.Registry,
		prometheus.HistogramOpts{
			Namespace: metrics.Namespace,
			Subsystem: interruptionSubsystem,
			Name:      "message_queue_duration_seconds",
			Help:      "Amount of time an interruption message is on the queue before it is processed by karpenter.",
			Buckets:   metrics.DurationBuckets(),
		},
		[]string{},
	)
)

Functions

This section is empty.

Types

type Action

type Action string
const (
	CordonAndDrain Action = "CordonAndDrain"
	NoAction       Action = "NoAction"
)

type Controller

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

Controller is an AWS interruption controller. It continually polls an SQS queue for events from aws.ec2 and aws.health that trigger node health events or node spot interruption/rebalance events.

func NewController

func NewController(
	kubeClient client.Client,
	cloudProvider cloudprovider.CloudProvider,
	clk clock.Clock,
	recorder events.Recorder,
	sqsProvider sqs.Provider,
	unavailableOfferingsCache *cache.UnavailableOfferings,
) *Controller

func (*Controller) Reconcile

func (c *Controller) Reconcile(ctx context.Context) (reconcile.Result, error)

func (*Controller) Register added in v0.37.0

func (c *Controller) Register(_ context.Context, m manager.Manager) error

type EventParser

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

func NewEventParser

func NewEventParser(parsers ...messages.Parser) *EventParser

func (EventParser) Parse

func (p EventParser) Parse(msg string) (messages.Message, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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