noderesources

package
v0.0.0-...-e2cac0c Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ErrReasonTooManyPods = "node(s) had too many pods"

Variables

This section is empty.

Functions

func ErrReasonRequestNotFitMessageFunc

func ErrReasonRequestNotFitMessageFunc(request, resource string) string

Types

type InsufficientResource

type InsufficientResource struct {
	ResourceName v1.ResourceName
	// We explicitly have a parameter for reason to avoid formatting a message on the fly
	// for common resources, which is expensive for cluster autoscaler simulations.
	Reason    string
	Requested int64
	Used      int64
	Capacity  int64
}

InsufficientResource describes what kind of resource limit is hit and caused the pod to not fit the node.

func FitsRequest

func FitsRequest(podRequest *PodRequest, nodeInfo framework.NodeInfo, ignoredExtendedResources, ignoredResourceGroups sets.String) *InsufficientResource

type PodRequest

type PodRequest struct {
	framework.Resource
	ResourceType    podutil.PodResourceType
	IgnorePodsLimit bool
	Err             error
}

PodRequest computed at PreFilter and used at Filter.

func ComputePodResourceRequest

func ComputePodResourceRequest(pod *v1.Pod) *PodRequest

ComputePodResourceRequest returns a framework.Resource that covers the largest width in each resource dimension. Because init-containers run sequentially, we collect the max in each dimension iteratively. In contrast, we sum the resource vectors for regular containers since they run simultaneously.

Example:

Pod:

InitContainers
  IC1:
    CPU: 2
    Memory: 1G
  IC2:
    CPU: 2
    Memory: 3G
Containers
  C1:
    CPU: 2
    Memory: 1G
  C2:
    CPU: 1
    Memory: 1G

Result: CPU: 3, Memory: 3G

Jump to

Keyboard shortcuts

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