package resource
import "k8s.io/client-go/pkg/api/v1/resource"
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(copier deepCopier, fs *v1.ResourceFieldSelector, pod *v1.Pod, containerName string, nodeAllocatable v1.ResourceList) (string, error)
- func GetResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64
- func MergeContainerResourceLimits(container *v1.Container, allocatable v1.ResourceList)
- func PodRequestsAndLimits(pod *v1.Pod) (reqs map[v1.ResourceName]resource.Quantity, limits map[v1.ResourceName]resource.Quantity, err error)
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(copier deepCopier, 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
finds and returns the request for a specific resource.
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.
func PodRequestsAndLimits ¶
func PodRequestsAndLimits(pod *v1.Pod) (reqs map[v1.ResourceName]resource.Quantity, limits map[v1.ResourceName]resource.Quantity, err error)
PodRequestsAndLimits returns a dictionary of all defined resources summed up for all containers of the pod.
Source Files ¶
helpers.go
- Version
- v4.0.0-beta.0+incompatible
- Published
- Jul 7, 2017
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 19 minutes ago –
Tools for package owners.