kubectlk8s.io/kubectl/pkg/util/resource Index | Files

package resource

import "k8s.io/kubectl/pkg/util/resource"

Index

Functions

func ExtractContainerResourceValue

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

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

func IsHugePageResourceName

func IsHugePageResourceName(name corev1.ResourceName) bool

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

func IsStandardContainerResourceName

func IsStandardContainerResourceName(str string) bool

IsStandardContainerResourceName returns true if the container can make a resource request for the specified resource

func PodRequestsAndLimits

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

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

Source Files

resource.go

Version
v0.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
1 month ago

Tools for package owners.