Documentation ¶
Index ¶
- func BuildNodeInfoForNode(node *kube_api.Node, client *kube_client.Client) (*schedulercache.NodeInfo, error)
- func CalculateReservation(node *kube_api.Node, nodeInfo *schedulercache.NodeInfo) (float64, error)
- func FastGetPodsToMove(nodeInfo *schedulercache.NodeInfo, force bool, failOnKubeSystemAddons bool, ...) ([]*api.Pod, error)
- func FindNodesToRemove(candidates []*kube_api.Node, allNodes []*kube_api.Node, pods []*kube_api.Pod, ...) ([]*kube_api.Node, error)
- func GetRequiredPodsForNode(nodename string, client *kube_client.Client) ([]*kube_api.Pod, error)
- type PredicateChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildNodeInfoForNode ¶
func BuildNodeInfoForNode(node *kube_api.Node, client *kube_client.Client) (*schedulercache.NodeInfo, error)
BuildNodeInfoForNode build a NodeInfo structure for the given node as if the node was just created.
func CalculateReservation ¶
CalculateReservation calculates reservation of a node.
func FastGetPodsToMove ¶
func FastGetPodsToMove(nodeInfo *schedulercache.NodeInfo, force bool, failOnKubeSystemAddons bool, decoder runtime.Decoder) ([]*api.Pod, error)
FastGetPodsToMove returns a list of pods that should be moved elsewhere if the node is drained. Raises error if there is an unreplicated pod and force option was not specified. Based on kubectl drain code. It makes an assumption that RC, DS, Jobs and RS were deleted along with their pods (no abandoned pods with dangling created-by annotation). Usefull for fast checks.
func FindNodesToRemove ¶
func FindNodesToRemove(candidates []*kube_api.Node, allNodes []*kube_api.Node, pods []*kube_api.Pod, client *kube_client.Client, predicateChecker *PredicateChecker, maxCount int, fastCheck bool) ([]*kube_api.Node, error)
FindNodesToRemove finds nodes that can be removed.
func GetRequiredPodsForNode ¶
GetRequiredPodsForNode returns a list od pods that would appear on the node if the node was just created (like deamonset and manifest-run pods). It reuses kubectl drain command to get the list.
Types ¶
type PredicateChecker ¶
type PredicateChecker struct {
// contains filtered or unexported fields
}
PredicateChecker checks whether all required predicates are matched for given Pod and Node
func NewPredicateChecker ¶
func NewPredicateChecker(kubeClient *kube_client.Client) (*PredicateChecker, error)
NewPredicateChecker builds PredicateChecker.
func (*PredicateChecker) CheckPredicates ¶
func (p *PredicateChecker) CheckPredicates(pod *kube_api.Pod, nodeInfo *schedulercache.NodeInfo) error
CheckPredicates checks if the given pod can be placed on the given node.
func (*PredicateChecker) FitsAny ¶
func (p *PredicateChecker) FitsAny(pod *kube_api.Pod, nodeInfos map[string]*schedulercache.NodeInfo) (string, error)
FitsAny checks if the given pod can be place on any of the given nodes.