customresources

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomResourceTarget

type CustomResourceTarget struct {
	// ResourceType is a type of targeted resources
	ResourceType string
	// ResourceCount is a count of targeted resources
	ResourceCount int64
}

CustomResourceTarget contains information about targeted custom resources

type CustomResourcesProcessor

type CustomResourcesProcessor interface {
	// FilterOutNodesWithUnreadyResources removes nodes that should have a custom resource, but don't have
	// it in allocatable from ready nodes list and updates their status to unready on all nodes list.
	FilterOutNodesWithUnreadyResources(context *context.AutoscalingContext, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node)
	// GetNodeResourceTargets returns mapping of resource names to their targets.
	GetNodeResourceTargets(context *context.AutoscalingContext, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) ([]CustomResourceTarget, errors.AutoscalerError)
	// CleanUp cleans up processor's internal structures.
	CleanUp()
}

CustomResourcesProcessor is interface defining handling custom resources

func NewDefaultCustomResourcesProcessor

func NewDefaultCustomResourcesProcessor() CustomResourcesProcessor

NewDefaultCustomResourcesProcessor returns a default instance of CustomResourcesProcessor.

type GpuCustomResourcesProcessor

type GpuCustomResourcesProcessor struct {
}

GpuCustomResourcesProcessor handles only the GPU custom resource. It assumes, that the GPU may not become allocatable immediately after the node creation. It uses additional hacks to predict the type/count of GPUs in that case.

func (*GpuCustomResourcesProcessor) CleanUp

func (p *GpuCustomResourcesProcessor) CleanUp()

CleanUp cleans up processor's internal structures.

func (*GpuCustomResourcesProcessor) FilterOutNodesWithUnreadyResources

func (p *GpuCustomResourcesProcessor) FilterOutNodesWithUnreadyResources(context *context.AutoscalingContext, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node)

FilterOutNodesWithUnreadyResources removes nodes that should have GPU, but don't have it in allocatable from ready nodes list and updates their status to unready on all nodes list. This is a hack/workaround for nodes with GPU coming up without installed drivers, resulting in GPU missing from their allocatable and capacity.

func (*GpuCustomResourcesProcessor) GetNodeGpuTarget

GetNodeGpuTarget returns the gpu target of a given node. This includes gpus that are not ready to use and visible in kubernetes.

func (*GpuCustomResourcesProcessor) GetNodeResourceTargets

GetNodeResourceTargets returns mapping of resource names to their targets. This includes resources which are not yet ready to use and visible in kubernetes.

Jump to

Keyboard shortcuts

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