Documentation ¶
Index ¶
- type CustomResourceTarget
- type CustomResourcesProcessor
- type GpuCustomResourcesProcessor
- func (p *GpuCustomResourcesProcessor) CleanUp()
- func (p *GpuCustomResourcesProcessor) FilterOutNodesWithUnreadyResources(context *context.AutoscalingContext, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node)
- func (p *GpuCustomResourcesProcessor) GetNodeGpuTarget(GPULabel string, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) (CustomResourceTarget, errors.AutoscalerError)
- func (p *GpuCustomResourcesProcessor) GetNodeResourceTargets(context *context.AutoscalingContext, node *apiv1.Node, ...) ([]CustomResourceTarget, errors.AutoscalerError)
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 ¶
func (p *GpuCustomResourcesProcessor) GetNodeGpuTarget(GPULabel string, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) (CustomResourceTarget, errors.AutoscalerError)
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 ¶
func (p *GpuCustomResourcesProcessor) GetNodeResourceTargets(context *context.AutoscalingContext, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) ([]CustomResourceTarget, errors.AutoscalerError)
GetNodeResourceTargets returns mapping of resource names to their targets. This includes resources which are not yet ready to use and visible in kubernetes.