calculate

package
v0.0.0-...-7ffc8d4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNodeConditionPred

func CheckNodeConditionPred(node *v1.Node) ([]types.PredicateFailureReason, error)

CheckNodeConditionPred check node ready status.

func ClusterPodRequestScheduling

func ClusterPodRequestScheduling(predPod *v1.Pod, nodeList *v1.NodeList, allrunPods *v1.PodList) *types.ClusterScheduling

func GeneralPred

func GeneralPred(node *v1.Node, nodePods []*v1.Pod, pod *v1.Pod) ([]types.PredicateFailureReason, error)

GeneralPred return node resource scheduling status.

func GetActivePods

func GetActivePods(allPods []*v1.Pod) []*v1.Pod

GetActivePods returns non-terminal pods

func ObjectCopy

func ObjectCopy(dst, src interface{}) error

ObjectCopy copy data.

func PodRequestScheduling

func PodRequestScheduling(predPod *v1.Pod, nodeList *v1.NodeList, allrunPods *v1.PodList) types.PodRequestScheduling

func PodToleratesNodeTaintsPred

func PodToleratesNodeTaintsPred(node *v1.Node, pod *v1.Pod) []types.PredicateFailureReason

PodToleratesNodeTaintsPred pod tolerates node taints pred.

Types

type InsufficientResource

type InsufficientResource struct {
	ResourceName v1.ResourceName
	// We explicitly have a parameter for reason to avoid formatting a message on the fly
	// for common resources, which is expensive for cluster autoscaler simulations.
	Reason    string
	Requested int64
	Used      int64
	Capacity  int64
}

InsufficientResource describes what kind of resource limit is hit and caused the pod to not fit the node.

func Fits

func Fits(pod *v1.Pod, nodeInfo *schedulernodeinfo.NodeInfo, ignoredExtendedResources sets.String) []InsufficientResource

Fits checks if node have enough resources to host the pod.

type InsufficientResourceError

type InsufficientResourceError struct {
	ResourceName v1.ResourceName
	Requested    int64
	Used         int64
	Capacity     int64
}

InsufficientResourceError is an error type that indicates what kind of resource limit is hit and caused the unfitting failure.

func (*InsufficientResourceError) Error

func (e *InsufficientResourceError) Error() string

func (*InsufficientResourceError) GetInsufficientAmount

func (e *InsufficientResourceError) GetInsufficientAmount() int64

GetInsufficientAmount returns the amount of the insufficient resource of the error.

func (*InsufficientResourceError) GetReason

func (e *InsufficientResourceError) GetReason() string

GetReason returns the reason of the InsufficientResourceError.

type NodeConditionError

type NodeConditionError struct {
	PredicateName string
	Reason        string
}

NodeConditionError describes a failure error of predicate.

func (*NodeConditionError) Error

func (e *NodeConditionError) Error() string

func (*NodeConditionError) GetReason

func (e *NodeConditionError) GetReason() string

GetReason returns the reason of the NodeConditionError.

type NodeConditionPredicate

type NodeConditionPredicate func(node *v1.Node) (bool, error)

NodeConditionPredicate is a function that indicates whether the given node's conditions meet some set of criteria defined by the function.

type PodToleratesNodeTaintsError

type PodToleratesNodeTaintsError struct {
	PredicateName string
	Reason        string
}

PodToleratesNodeTaintsError describes a failure error of predicate.

func (*PodToleratesNodeTaintsError) Error

func (*PodToleratesNodeTaintsError) GetReason

func (e *PodToleratesNodeTaintsError) GetReason() string

GetReason returns the reason of the NodeConditionError.

type PredicateFailureError

type PredicateFailureError struct {
	PredicateName string
	PredicateDesc string
}

PredicateFailureError describes a failure error of predicate.

func (*PredicateFailureError) Error

func (e *PredicateFailureError) Error() string

func (*PredicateFailureError) GetReason

func (e *PredicateFailureError) GetReason() string

GetReason returns the reason of the PredicateFailureError.

Jump to

Keyboard shortcuts

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