kubernetes: k8s.io/kubernetes/pkg/api/v1/resource Index | Files

package resource

import "k8s.io/kubernetes/pkg/api/v1/resource"

Index

Package Files

helpers.go

func ExtractContainerResourceValue Uses

func ExtractContainerResourceValue(fs *v1.ResourceFieldSelector, container *v1.Container) (string, error)

ExtractContainerResourceValue extracts the value of a resource in an already known container

func ExtractResourceValueByContainerName Uses

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 Uses

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 Uses

func GetResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64

GetResourceRequest finds and returns the request value for a specific resource.

func GetResourceRequestQuantity Uses

func GetResourceRequestQuantity(pod *v1.Pod, resourceName v1.ResourceName) resource.Quantity

GetResourceRequestQuantity finds and returns the request quantity for a specific resource.

func IsHugePageResourceName Uses

func IsHugePageResourceName(name v1.ResourceName) bool

IsHugePageResourceName returns true if the resource name has the huge page resource prefix.

func MergeContainerResourceLimits Uses

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.

func PodRequestsAndLimits Uses

func PodRequestsAndLimits(pod *v1.Pod) (reqs, limits v1.ResourceList)

PodRequestsAndLimits returns a dictionary of all defined resources summed up for all containers of the pod. If PodOverhead feature is enabled, pod overhead is added to the total container resource requests and to the total container limits which have a non-zero quantity.

func PodRequestsAndLimitsReuse Uses

func PodRequestsAndLimitsReuse(pod *v1.Pod, reuseReqs, reuseLimits v1.ResourceList) (reqs, limits v1.ResourceList)

PodRequestsAndLimitsReuse returns a dictionary of all defined resources summed up for all containers of the pod. If PodOverhead feature is enabled, pod overhead is added to the total container resource requests and to the total container limits which have a non-zero quantity. The caller may avoid allocations of resource lists by passing a requests and limits list to the function, which will be cleared before use.

Package resource imports 8 packages (graph) and is imported by 97 packages. Updated 2020-11-16. Refresh now. Tools for package owners.