status

package
v0.0.0-...-503a17f Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReasonsMessage

func ReasonsMessage(noScaleUpInfo NoScaleUpInfo) string

ReasonsMessage aggregates reasons from NoScaleUpInfos.

Types

type AutoscalingStatusProcessor

type AutoscalingStatusProcessor interface {
	Process(context *context.AutoscalingContext, csr *clusterstate.ClusterStateRegistry, now time.Time) error
	CleanUp()
}

AutoscalingStatusProcessor processes the status of the cluster after each autoscaling iteration. It's triggered at the end of Autoscaler's RunOnce method.

func NewDefaultAutoscalingStatusProcessor

func NewDefaultAutoscalingStatusProcessor() AutoscalingStatusProcessor

NewDefaultAutoscalingStatusProcessor creates a default instance of AutoscalingStatusProcessor.

type EventingScaleUpStatusProcessor

type EventingScaleUpStatusProcessor struct{}

EventingScaleUpStatusProcessor processes the state of the cluster after a scale-up by emitting relevant events for pods depending on their post scale-up status.

func (*EventingScaleUpStatusProcessor) CleanUp

func (p *EventingScaleUpStatusProcessor) CleanUp()

CleanUp cleans up the processor's internal structures.

func (*EventingScaleUpStatusProcessor) Process

Process processes the state of the cluster after a scale-up by emitting relevant events for pods depending on their post scale-up status.

type NoOpAutoscalingStatusProcessor

type NoOpAutoscalingStatusProcessor struct{}

NoOpAutoscalingStatusProcessor is an AutoscalingStatusProcessor implementation useful for testing.

func (*NoOpAutoscalingStatusProcessor) CleanUp

func (p *NoOpAutoscalingStatusProcessor) CleanUp()

CleanUp cleans up the processor's internal structures.

func (*NoOpAutoscalingStatusProcessor) Process

Process processes the status of the cluster after an autoscaling iteration.

type NoOpScaleDownStatusProcessor

type NoOpScaleDownStatusProcessor struct{}

NoOpScaleDownStatusProcessor is a ScaleDownStatusProcessor implementations useful for testing.

func (*NoOpScaleDownStatusProcessor) CleanUp

func (p *NoOpScaleDownStatusProcessor) CleanUp()

CleanUp cleans up the processor's internal structures.

func (*NoOpScaleDownStatusProcessor) Process

Process processes the status of the cluster after a scale-down.

type NoOpScaleUpStatusProcessor

type NoOpScaleUpStatusProcessor struct{}

NoOpScaleUpStatusProcessor is a ScaleUpStatusProcessor implementations useful for testing.

func (*NoOpScaleUpStatusProcessor) CleanUp

func (p *NoOpScaleUpStatusProcessor) CleanUp()

CleanUp cleans up the processor's internal structures.

func (*NoOpScaleUpStatusProcessor) Process

Process processes the status of the cluster after a scale-up.

type NoScaleUpInfo

type NoScaleUpInfo struct {
	Pod                *apiv1.Pod
	RejectedNodeGroups map[string]Reasons
	SkippedNodeGroups  map[string]Reasons
}

NoScaleUpInfo contains information about a pod that didn't trigger scale-up.

type Reasons

type Reasons interface {
	Reasons() []string
}

Reasons interface provides a list of reasons for why something happened or didn't happen.

type ScaleDownNode

type ScaleDownNode struct {
	Node        *apiv1.Node
	NodeGroup   cloudprovider.NodeGroup
	EvictedPods []*apiv1.Pod
	UtilInfo    simulator.UtilizationInfo
}

ScaleDownNode represents the state of a node that's being scaled down.

type ScaleDownResult

type ScaleDownResult int

ScaleDownResult represents the result of scale down.

const (
	// ScaleDownError - scale down finished with error.
	ScaleDownError ScaleDownResult = iota
	// ScaleDownNoUnneeded - no unneeded nodes and no errors.
	ScaleDownNoUnneeded
	// ScaleDownNoNodeDeleted - unneeded nodes present but not available for deletion.
	ScaleDownNoNodeDeleted
	// ScaleDownNodeDeleted - a node was deleted.
	ScaleDownNodeDeleted
	// ScaleDownNodeDeleteStarted - a node deletion process was started.
	ScaleDownNodeDeleteStarted
	// ScaleDownNotTried - the scale down wasn't even attempted, e.g. an autoscaling iteration was skipped, or
	// an error occurred before the scale up logic.
	ScaleDownNotTried
	// ScaleDownInCooldown - the scale down wasn't even attempted, because it's in a cooldown state (it's suspended for a scheduled period of time).
	ScaleDownInCooldown
	// ScaleDownInProgress - the scale down wasn't attempted, because a previous scale-down was still in progress.
	ScaleDownInProgress
)

type ScaleDownStatus

type ScaleDownStatus struct {
	Result            ScaleDownResult
	ScaledDownNodes   []*ScaleDownNode
	NodeDeleteResults map[string]error
}

ScaleDownStatus represents the state of scale down.

type ScaleDownStatusProcessor

type ScaleDownStatusProcessor interface {
	Process(context *context.AutoscalingContext, status *ScaleDownStatus)
	CleanUp()
}

ScaleDownStatusProcessor processes the status of the cluster after a scale-down.

func NewDefaultScaleDownStatusProcessor

func NewDefaultScaleDownStatusProcessor() ScaleDownStatusProcessor

NewDefaultScaleDownStatusProcessor creates a default instance of ScaleUpStatusProcessor.

type ScaleUpResult

type ScaleUpResult int

ScaleUpResult represents the result of a scale up.

const (
	// ScaleUpSuccessful - a scale-up successfully occurred.
	ScaleUpSuccessful ScaleUpResult = iota
	// ScaleUpError - an unexpected error occurred during the scale-up attempt.
	ScaleUpError
	// ScaleUpNoOptionsAvailable - there were no node groups that could be considered for the scale-up.
	ScaleUpNoOptionsAvailable
	// ScaleUpNotNeeded - there was no need for a scale-up e.g. because there were no unschedulable pods.
	ScaleUpNotNeeded
	// ScaleUpNotTried - the scale up wasn't even attempted, e.g. an autoscaling iteration was skipped, or
	// an error occurred before the scale up logic.
	ScaleUpNotTried
	// ScaleUpInCooldown - the scale up wasn't even attempted, because it's in a cooldown state (it's suspended for a scheduled period of time).
	ScaleUpInCooldown
)

type ScaleUpStatus

type ScaleUpStatus struct {
	Result                  ScaleUpResult
	ScaleUpInfos            []nodegroupset.ScaleUpInfo
	PodsTriggeredScaleUp    []*apiv1.Pod
	PodsRemainUnschedulable []NoScaleUpInfo
	PodsAwaitEvaluation     []*apiv1.Pod
}

ScaleUpStatus is the status of a scale-up attempt. This includes information on if scale-up happened, description of scale-up operation performed and status of pods that took part in the scale-up evaluation.

func (*ScaleUpStatus) WasSuccessful

func (s *ScaleUpStatus) WasSuccessful() bool

WasSuccessful returns true if the scale-up was successful.

type ScaleUpStatusProcessor

type ScaleUpStatusProcessor interface {
	Process(context *context.AutoscalingContext, status *ScaleUpStatus)
	CleanUp()
}

ScaleUpStatusProcessor processes the status of the cluster after a scale-up.

func NewDefaultScaleUpStatusProcessor

func NewDefaultScaleUpStatusProcessor() ScaleUpStatusProcessor

NewDefaultScaleUpStatusProcessor creates a default instance of ScaleUpStatusProcessor.

Jump to

Keyboard shortcuts

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