podutil

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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'

type PodReadyCounter

type PodReadyCounter interface {
	GetReadyPodsCount(namespace string, selector labels.Selector) (int64, error)
}

PodReadyCounter provides a way to count number of ready pods

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL