# Functions
AddNodeNameIndexerForPod add node name index for pod informer.
AddResources sums up two ResourceList, and returns the summed as results.
AggregateAvgQuantities get the average of the quantities.
AggregateMaxQuantities get the maximum of the quantities.
AggregateSumQuantities get the sum of quantities.
ApplyPodResources is used to apply map[string]v1.ResourceRequirements to the given pod, and ignore the container-names / resource-names that not appear in the given map param.
CalculateQoSResource calculates the QoS Resource of a Pod resourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead.
CalculateResource resourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers).
CheckContainerNotRunning returns whether the given container is not-runnin.
CheckDaemonPod returns true if pod is for DaemonSet.
CheckObjectEqual returns true if uid equals or the namespace/name pair equal.
CheckQosClassChanged checks whether the pod's QosClass will change if annotationResources are applied to this pod.
No description provided by the author
DeepCopyPodContainers returns a deep-copied objects for v1.Container slice.
DefaultCPUQuantityGetter returns cpu quantity for resourceList.
DefaultMemoryQuantityGetter returns memory quantity for resourceList.
EmitResourceMetrics emit metrics for given ResourceList.
No description provided by the author
FilterOutSkipEvictionPods return pods should be candidates to evict including native critical pods and user-defined filtered pods.
FilterPodAnnotations returns the needed annotations for the given pod.
FilterPods filter pods that filter func return true.
GenerateContainerName return a unique key for a container.
GenerateDynamicResourceByGVR generates dynamic resource by given gvr, the format is such as `resource.version.group`, which can be input of ParseResourceArg.
GenerateNamespaceNameKey generate uniq key by concatenating namespace and name.
GenerateObjectOwnerReferenceKey is to generate a unique key by owner reference.
GeneratePodContainerName return a unique key for a container in a pod.
GenerateUniqGVRNameKey generate a uniq key (without UID) for the GVR and its corresponding object.
GenerateUniqObjectNameKey generate a uniq key (without UID) for the given object.
GenerateUniqObjectUIDKey generate a uniq key (including UID) for the given object.
GetAndUnmarshalForHttps gets data from the given url and unmarshal it into the given struct.
GetContainerEnvs gets container envs from pod spec by container name and envs name.
GetContainerID gets container id from pod status by container name.
GetNamespacedNameListFromSlice returns a slice of namespaced name.
GetNonzeroQoSRequests returns the default reclaimed_millicpu and reclaimed_memory resource request if none is found or what is provided on the request.
GetPodCondition extracts the given condition for the given pod.
No description provided by the author
GetPodListForWorkload returns pod list that belong to the given workload we will use label selector to find pods, and this may require that the given workload is limited to several selected objects.
No description provided by the author
GetPodsAssignedToNode returns pods that belong to this node by indexer.
No description provided by the author
GetRequestForQoSResource returns the requested values unless nonZero is true and there is no defined request for CPU and memory.
No description provided by the author
GetUnstructuredSelector parse a unstructured object and return its labelSelector (for pods).
GetUnstructuredTemplateAnnotations parse a unstructured object and return its template's annotations (for workload like deployments, statefulsets).
IsAssignedPod selects pods that are assigned (scheduled and running).
IsResourceGreaterThan checks if recommended resource is scaling down.
No description provided by the author
MergeResources merge multi ResourceList into one ResourceList, the resource of same resource name in all ResourceList we only use the first merged one.
MultiplyMilliQuantity scales quantity by y.
MultiplyQuantity scales quantity by y.
MultiplyResourceQuantity scales quantity according to its resource name.
NewDynamicResourcesManager initializes a dynamic resources manger to manage dynamic informers.
No description provided by the author
No description provided by the author
ObjectOwnerReferenceIndex is used by informer to index a resource by owner.
ParseContainerName parse key and return container name.
ParseHostPortForPod gets host ports from pod spec.
ParseHostPortsForContainer gets host port from container spec.
ParseNamespaceNameUIDKey parse the given key into namespace/name/uid.
ParsePodContainerName parse key and return pod name and container name.
ParseUniqGVRNameKey parse the given key into GVR and namespace/name.
ParseUniqObjectUIDKey parse the given key into namespace, name and uid.
No description provided by the author
PodAnnotationFilter is used to filter pods annotated with a pair of specific key and value.
PodCPURequestCmpFunc sorts cpu request of pods with less comparison.
No description provided by the author
PodIsActive returns whether the pod is not terminated.
PodIsPending returns whether the pod is pending.
PodIsReady returns whether the pod is at ready state.
PodIsTerminated returns whether the pod is at terminal state.
PodPriorityCmpFunc sorts priority of pods with greater comparison.
PodResourceDiff checks if pod resources are not the same as the given resource map, both for requests and limits.
PodUniqKeyCmpFunc sorts uniq key of pod with greater comparison.
ResourceQuantityToInt64Value returns the int64 value according to its resource name.
ResourcesEqual checks whether the given resources are equal with each other.
ResourcesLess checks whether the given resources a are less than b.
No description provided by the author
No description provided by the author
No description provided by the author
SumUpPodLimitResources sum up resources in all containers request init container is included (count on the max limit of all init containers).
SumUpPodRequestResources sum up resources in all containers request init container is included (count on the max request of all init containers).
No description provided by the author
No description provided by the author
TrimContainerIDPrefix is used to parse the specific containerID out of the whole containerID info.
VisitUnstructuredAncestors is to walk through all the ancestors of the given object, during this process, we will try to handle each ancestor with the given util function.
# Constants
No description provided by the author
No description provided by the author
200 MiB.
0.1 core.
# Variables
No description provided by the author
# Structs
DynamicInformer keeps the informer-related contents for each workload.
No description provided by the author
KubeletConfiguration contains the configuration for the Kubelet This struct is a simplification of the definition in the kubelet api repo, holding only the fields used by katalyst.
No description provided by the author
QoSResource is a collection of compute resource.
# Type aliases
No description provided by the author
PodResource key: namespace/name, value: pod requested ResourceList.
No description provided by the author
No description provided by the author
ResourceThreshold is map of resource name to threshold of water level.