Documentation ¶
Index ¶
- func ExtractContainerResourceValue(fs *v1.ResourceFieldSelector, container *v1.Container) (string, error)
- func ExtractResourceValueByContainerName(fs *v1.ResourceFieldSelector, pod *v1.Pod, containerName string) (string, error)
- func ExtractResourceValueByContainerNameAndNodeAllocatable(fs *v1.ResourceFieldSelector, pod *v1.Pod, containerName string, ...) (string, error)
- func GetResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64
- func GetResourceRequestQuantity(pod *v1.Pod, resourceName v1.ResourceName) resource.Quantity
- func IsHugePageResourceName(name v1.ResourceName) bool
- func MergeContainerResourceLimits(container *v1.Container, allocatable v1.ResourceList)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractContainerResourceValue ¶
func ExtractContainerResourceValue(fs *v1.ResourceFieldSelector, container *v1.Container) (string, error)
ExtractContainerResourceValue extracts the value of a resource in an already known container
func ExtractResourceValueByContainerName ¶
func ExtractResourceValueByContainerName(fs *v1.ResourceFieldSelector, pod *v1.Pod, containerName string) (string, error)
ExtractResourceValueByContainerName extracts the value of a resource by providing container name
func ExtractResourceValueByContainerNameAndNodeAllocatable ¶
func ExtractResourceValueByContainerNameAndNodeAllocatable(fs *v1.ResourceFieldSelector, pod *v1.Pod, containerName string, nodeAllocatable v1.ResourceList) (string, error)
ExtractResourceValueByContainerNameAndNodeAllocatable extracts the value of a resource by providing container name and node allocatable
func GetResourceRequest ¶
func GetResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64
GetResourceRequest finds and returns the request value for a specific resource.
func GetResourceRequestQuantity ¶ added in v1.16.0
GetResourceRequestQuantity finds and returns the request quantity for a specific resource.
func IsHugePageResourceName ¶ added in v1.20.0
func IsHugePageResourceName(name v1.ResourceName) bool
IsHugePageResourceName returns true if the resource name has the huge page resource prefix.
func MergeContainerResourceLimits ¶
func MergeContainerResourceLimits(container *v1.Container, allocatable v1.ResourceList)
MergeContainerResourceLimits checks if a limit is applied for the container, and if not, it sets the limit to the passed resource list.
Types ¶
This section is empty.