Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceCalculator ¶
type ResourceCalculator struct {
NvidiaGPUDeviceMemoryGB int64
}
func (ResourceCalculator) ComputePodRequest ¶
func (r ResourceCalculator) ComputePodRequest(pod v1.Pod) v1.ResourceList
ComputePodRequest returns a v1.ResourceList 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.
If Pod Overhead is specified and the feature gate is set, the resources defined for Overhead are added to the calculated Resource request sum
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
func (ResourceCalculator) ComputeRequiredGPUMemoryGB ¶
func (r ResourceCalculator) ComputeRequiredGPUMemoryGB(resourceList v1.ResourceList) int64
Click to show internal directories.
Click to hide internal directories.