podinjection

package
v0.0.0-...-da31dff Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InjectedMetricsLabel is the label for unschedulable pods metric for injected pods.
	InjectedMetricsLabel = "injected"
	// SkippedInjectionMetricsLabel is the label for unschedulable pods metric for pods that was not injected due to limit.
	SkippedInjectionMetricsLabel = "skipped_injection"
)
View Source
const (
	// FakePodAnnotationKey the key for pod type
	FakePodAnnotationKey = "podtype"
	// FakePodAnnotationValue the value for a fake pod
	FakePodAnnotationValue = "fakepod"
)

Variables

This section is empty.

Functions

func IsFake

func IsFake(pod *apiv1.Pod) bool

IsFake returns true if the a pod is marked as fake and false otherwise

Types

type EnforceInjectedPodsLimitProcessor

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

EnforceInjectedPodsLimitProcessor is a PodListProcessor used to limit the number of injected fake pods.

func NewEnforceInjectedPodsLimitProcessor

func NewEnforceInjectedPodsLimitProcessor(podLimit int) *EnforceInjectedPodsLimitProcessor

NewEnforceInjectedPodsLimitProcessor return an instance of EnforceInjectedPodsLimitProcessor

func (*EnforceInjectedPodsLimitProcessor) CleanUp

func (p *EnforceInjectedPodsLimitProcessor) CleanUp()

CleanUp is called at CA termination

func (*EnforceInjectedPodsLimitProcessor) Process

func (p *EnforceInjectedPodsLimitProcessor) Process(ctx *context.AutoscalingContext, unschedulablePods []*apiv1.Pod) ([]*apiv1.Pod, error)

Process filters unschedulablePods and enforces the limit of the number of injected pods

type FakePodsScaleUpStatusProcessor

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

FakePodsScaleUpStatusProcessor is a ScaleUpStatusProcessor used for filtering out fake pods from scaleup status.

func NewFakePodsScaleUpStatusProcessor

func NewFakePodsScaleUpStatusProcessor(fakePodRegistry *podinjectionbackoff.ControllerRegistry) *FakePodsScaleUpStatusProcessor

NewFakePodsScaleUpStatusProcessor return an instance of FakePodsScaleUpStatusProcessor

func (*FakePodsScaleUpStatusProcessor) CleanUp

func (a *FakePodsScaleUpStatusProcessor) CleanUp()

CleanUp is called at CA termination

func (*FakePodsScaleUpStatusProcessor) Process

Process updates scaleupStatus to remove all fake pods from PodsRemainUnschedulable, PodsAwaitEvaluation & PodsTriggeredScaleup

type PodInjectionPodListProcessor

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

PodInjectionPodListProcessor is a PodListProcessor used to inject fake pods to consider replica count in the respective controllers for the scale-up. For each controller, #fake pods injected = #replicas specified the controller - #scheduled pods - #finished pods - #unschedulable pods

func NewPodInjectionPodListProcessor

func NewPodInjectionPodListProcessor(fakePodRegistry *podinjectionbackoff.ControllerRegistry) *PodInjectionPodListProcessor

NewPodInjectionPodListProcessor return an instance of PodInjectionPodListProcessor

func (*PodInjectionPodListProcessor) CleanUp

func (p *PodInjectionPodListProcessor) CleanUp()

CleanUp is called at CA termination

func (*PodInjectionPodListProcessor) Process

func (p *PodInjectionPodListProcessor) Process(ctx *context.AutoscalingContext, unschedulablePods []*apiv1.Pod) ([]*apiv1.Pod, error)

Process updates unschedulablePods by injecting fake pods to match target replica count

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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