provreq

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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefautlEventManager

func NewDefautlEventManager() *defaultEventManager

NewDefautlEventManager return basic event manager.

func NewProvReqProcessor

func NewProvReqProcessor(client *provreqclient.ProvisioningRequestClient, predicateChecker predicatechecker.PredicateChecker) *provReqProcessor

NewProvReqProcessor return ProvisioningRequestProcessor.

func NewProvisioningRequestPodsFilter

func NewProvisioningRequestPodsFilter(e EventManager) pods.PodListProcessor

NewProvisioningRequestPodsFilter creates a ProvisioningRequest filter processor.

Types

type EventManager

type EventManager interface {
	LogIgnoredInScaleUpEvent(context *context.AutoscalingContext, now time.Time, pod *apiv1.Pod, prName string)
	Reset()
}

EventManager is an interface for handling events for provisioning request.

type ProvisioningRequestPodsFilter

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

ProvisioningRequestPodsFilter filter out pods that consumes Provisioning Request

func (*ProvisioningRequestPodsFilter) CleanUp

func (p *ProvisioningRequestPodsFilter) CleanUp()

CleanUp cleans up the processor's internal structures.

func (*ProvisioningRequestPodsFilter) Process

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

Process filters out all pods that are consuming a Provisioning Request from unschedulable pods list.

type ProvisioningRequestPodsInjector

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

ProvisioningRequestPodsInjector creates in-memory pods from ProvisioningRequest and inject them to unscheduled pods list.

func NewFakePodsInjector

NewFakePodsInjector creates a new instance of ProvisioningRequestPodsInjector with the given client and clock for testing.

func NewProvisioningRequestPodsInjector

func NewProvisioningRequestPodsInjector(kubeConfig *rest.Config, initialBackoffTime, maxBackoffTime time.Duration, maxCacheSize int) (*ProvisioningRequestPodsInjector, error)

NewProvisioningRequestPodsInjector creates a ProvisioningRequest filter processor.

func (*ProvisioningRequestPodsInjector) CleanUp

func (p *ProvisioningRequestPodsInjector) CleanUp()

CleanUp cleans up the processor's internal structures.

func (*ProvisioningRequestPodsInjector) GetPodsFromNextRequest

func (p *ProvisioningRequestPodsInjector) GetPodsFromNextRequest(
	isSupportedClass func(*provreqwrapper.ProvisioningRequest) bool,
) ([]*apiv1.Pod, error)

GetPodsFromNextRequest picks one ProvisioningRequest meeting the condition passed using isSupportedClass function, marks it as accepted and returns pods from it.

func (*ProvisioningRequestPodsInjector) IsAvailableForProvisioning

func (p *ProvisioningRequestPodsInjector) IsAvailableForProvisioning(pr *provreqwrapper.ProvisioningRequest) bool

IsAvailableForProvisioning checks if the provisioning request is the correct state for processing and provisioning has not been attempted recently.

func (*ProvisioningRequestPodsInjector) LastProvisioningRequestProcessTime

func (p *ProvisioningRequestPodsInjector) LastProvisioningRequestProcessTime() time.Time

LastProvisioningRequestProcessTime returns the time when the last provisioning request was processed.

func (*ProvisioningRequestPodsInjector) MarkAsAccepted

MarkAsAccepted marks the ProvisioningRequest as accepted.

func (*ProvisioningRequestPodsInjector) MarkAsFailed

func (p *ProvisioningRequestPodsInjector) MarkAsFailed(pr *provreqwrapper.ProvisioningRequest, reason string, message string)

MarkAsFailed marks the ProvisioningRequest as failed.

func (*ProvisioningRequestPodsInjector) Process

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

Process pick one ProvisioningRequest, update Accepted condition and inject pods to unscheduled pods list.

Jump to

Keyboard shortcuts

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