Documentation
¶
Index ¶
- Variables
- func FilterOutPreemptablePods(pods []*v1.Pod) ([]*v1.Pod, []*v1.Pod)
- func GetTotalRequest(pods []*v1.Pod, fns []FilterPodsFunc, resTypes []v1.ResourceName) v1.ResourceList
- func GuaranteedPodsCPURequest(pods []*v1.Pod) int64
- func IncludeGuaranteedPods() bool
- func IsGuaranteedAndNonPreemptablePods(pod *v1.Pod) bool
- func IsPodTerminated(pod *v1.Pod) bool
- func IsPreemptablePod(pod *v1.Pod) bool
- type ActivePods
- type FilterPodsFunc
- type KillPod
- type Resources
- type SortedPodsByRequestCPU
- type SortedPodsByRequestMemory
Constants ¶
This section is empty.
Variables ¶
var IncludeGuaranteedPodsFn filterPodsFunc = func(b bool) FilterPodsFunc {
f := func(pod *v1.Pod, resType v1.ResourceName) bool {
return !b && resType == v1.ResourceCPU && IsGuaranteedAndNonPreemptablePods(pod)
}
return f
}
var IncludeOversoldPodFn filterPodsFunc = func(b bool) FilterPodsFunc {
f := func(pod *v1.Pod, resType v1.ResourceName) bool {
return !b && IsPreemptablePod(pod)
}
return f
}
Functions ¶
func FilterOutPreemptablePods ¶
func FilterOutPreemptablePods(pods []*v1.Pod) ([]*v1.Pod, []*v1.Pod)
FilterOutPreemptablePods return pods those are not preemptable
func GetTotalRequest ¶
func GetTotalRequest(pods []*v1.Pod, fns []FilterPodsFunc, resTypes []v1.ResourceName) v1.ResourceList
GetTotalRequest return the total resource of pods
func GuaranteedPodsCPURequest ¶
func GuaranteedPodsCPURequest(pods []*v1.Pod) int64
func IncludeGuaranteedPods ¶
func IncludeGuaranteedPods() bool
func IsGuaranteedAndNonPreemptablePods ¶
func IsGuaranteedAndNonPreemptablePods(pod *v1.Pod) bool
IsGuaranteedAndNonPreemptablePods return whether pod is guaranteed, but preemptable guaranteed pods are excluded.
func IsPodTerminated ¶
func IsPodTerminated(pod *v1.Pod) bool
IsPodTerminated return true if pod is terminated.
func IsPreemptablePod ¶
func IsPreemptablePod(pod *v1.Pod) bool
IsPreemptablePod check if a pod an offline pod.
Types ¶
type ActivePods ¶
type ActivePods func() ([]*v1.Pod, error)
ActivePods returns pods bound to the kubelet that are active (i.e. non-terminal state)
type FilterPodsFunc ¶
type FilterPodsFunc func(*v1.Pod, v1.ResourceName) bool
type KillPod ¶
type KillPod func(ctx context.Context, client clientset.Interface, gracePeriodSeconds *int64, pod *v1.Pod, evictionVersion string) error
type Resources ¶
type Resources struct {
CgroupSubSystem cgroup.CgroupSubsystem
ContainerID string
SubPath string
Value int64
}
Resources represents container level resources.
func CalculateExtendResources ¶
func CalculateExtendResources(pod *v1.Pod) []Resources
CalculateExtendResources calculates pod and container that use extend resource level cgroup resource, include cpu and memory
type SortedPodsByRequestCPU ¶
type SortedPodsByRequestCPU []*v1.Pod
SortedPodsByRequestCPU sort pods by cpu request value.
type SortedPodsByRequestMemory ¶
type SortedPodsByRequestMemory []*v1.Pod
SortedPodsByRequestMemory sort pods by memory request value.