Documentation ¶
Overview ¶
Package podutil provides utilities for getting pod information from the K8s APIs.
Index ¶
- func CalculatePodRequests(pods []*corev1.Pod, resource corev1.ResourceName) (map[string]int64, error)
- func GroupPods(pods []*corev1.Pod, metrics podmetrics.MetricsInfo, ...) (readyPodCount int, ignoredPods sets.String, missingPods sets.String)
- func RemoveMetricsForPods(metrics podmetrics.MetricsInfo, pods sets.String)
- type PodReadyCount
- type PodReadyCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePodRequests ¶
func CalculatePodRequests(pods []*corev1.Pod, resource corev1.ResourceName) (map[string]int64, error)
CalculatePodRequests calculates pod resource requests for a slice of pods
func GroupPods ¶
func GroupPods(pods []*corev1.Pod, metrics podmetrics.MetricsInfo, resource corev1.ResourceName, cpuInitializationPeriod, delayOfInitialReadinessStatus time.Duration) (readyPodCount int, ignoredPods sets.String, missingPods sets.String)
GroupPods groups pods into ready, missing and ignored based on PodMetricsInfo and resource provided
func RemoveMetricsForPods ¶
func RemoveMetricsForPods(metrics podmetrics.MetricsInfo, pods sets.String)
RemoveMetricsForPods removes the pods provided from the PodMetricsInfo provided
Types ¶
type PodReadyCount ¶
type PodReadyCount struct {
PodLister corelisters.PodLister
}
PodReadyCount provides a way to count the number of ready pods using a pod lister
func (*PodReadyCount) GetReadyPodsCount ¶
func (c *PodReadyCount) GetReadyPodsCount(namespace string, selector labels.Selector) (int64, error)
GetReadyPodsCount returns the number of pods that are deemed 'ready'
Click to show internal directories.
Click to hide internal directories.