Documentation ¶
Index ¶
- func IsBestEffortPod(pod *corev1.Pod) bool
- func IsBurstablePod(pod *corev1.Pod) bool
- func IsGuaranteedPod(pod *corev1.Pod) bool
- func ListAllPodsOnANode(nodeName string, getPodsAssignedToNode GetPodsAssignedToNodeFunc, ...) ([]*corev1.Pod, error)
- func ListPodsOnANode(nodeName string, getPodsAssignedToNode GetPodsAssignedToNodeFunc, ...) ([]*corev1.Pod, error)
- func OwnerRef(pod *corev1.Pod) []metav1.OwnerReference
- func SortPodsBasedOnAge(pods []*corev1.Pod)
- func SortPodsBasedOnPriorityLowToHigh(pods []*corev1.Pod)
- type FilterFunc
- type GetPodsAssignedToNodeFunc
- type Options
- func (o *Options) BuildFilterFunc() (FilterFunc, error)
- func (o *Options) WithFilter(filter FilterFunc) *Options
- func (o *Options) WithLabelSelector(labelSelector *metav1.LabelSelector) *Options
- func (o *Options) WithNamespaces(namespaces sets.String) *Options
- func (o *Options) WithoutNamespaces(namespaces sets.String) *Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBestEffortPod ¶
func IsBurstablePod ¶
func IsGuaranteedPod ¶
func ListAllPodsOnANode ¶
func ListAllPodsOnANode( nodeName string, getPodsAssignedToNode GetPodsAssignedToNodeFunc, filter FilterFunc, ) ([]*corev1.Pod, error)
ListAllPodsOnANode lists all the pods on a node no matter what the phase of the pod is.
func ListPodsOnANode ¶
func ListPodsOnANode( nodeName string, getPodsAssignedToNode GetPodsAssignedToNodeFunc, filter FilterFunc, ) ([]*corev1.Pod, error)
ListPodsOnANode lists all pods on a node. It also accepts a "filter" function which can be used to further limit the pods that are returned. (Usually this is podEvictor.Evictable().IsEvictable, in order to only list the evictable pods on a node, but can be used by strategies to extend it if there are further restrictions, such as with NodeAffinity).
func OwnerRef ¶
func OwnerRef(pod *corev1.Pod) []metav1.OwnerReference
OwnerRef returns the ownerRefList for the pod.
func SortPodsBasedOnAge ¶
SortPodsBasedOnAge sorts Pods from oldest to most recent in place
func SortPodsBasedOnPriorityLowToHigh ¶
SortPodsBasedOnPriorityLowToHigh sorts pods based on their priorities from low to high. If pods have same priorities, they will be sorted by QoS in the following order: BestEffort, Burstable, Guaranteed
Types ¶
type FilterFunc ¶
type FilterFunc = framework.FilterFunc
FilterFunc is a filter for a pod.
func WrapFilterFuncs ¶
func WrapFilterFuncs(filters ...FilterFunc) FilterFunc
WrapFilterFuncs wraps a set of FilterFunc in one.
type GetPodsAssignedToNodeFunc ¶
type GetPodsAssignedToNodeFunc = framework.GetPodsAssignedToNodeFunc
GetPodsAssignedToNodeFunc is a function which accept a node name and a pod filter function as input and returns the pods that assigned to the node.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) BuildFilterFunc ¶
func (o *Options) BuildFilterFunc() (FilterFunc, error)
BuildFilterFunc builds a final FilterFunc based on Options.
func (*Options) WithFilter ¶
func (o *Options) WithFilter(filter FilterFunc) *Options
WithFilter sets a pod filter. The filter function should return true if the pod should be returned from ListPodsOnANode
func (*Options) WithLabelSelector ¶
func (o *Options) WithLabelSelector(labelSelector *metav1.LabelSelector) *Options
WithLabelSelector sets a pod label selector
func (*Options) WithNamespaces ¶
WithNamespaces sets included namespaces