Documentation ¶
Index ¶
- func BalancedResourceAllocation(pod *api.Pod, podLister algorithm.PodLister, ...) (algorithm.HostPriorityList, error)
- func LeastRequestedPriority(pod *api.Pod, podLister algorithm.PodLister, ...) (algorithm.HostPriorityList, error)
- func NewNodeLabelPriority(label string, presence bool) algorithm.PriorityFunction
- func NewServiceAntiAffinityPriority(serviceLister algorithm.ServiceLister, label string) algorithm.PriorityFunction
- func NewServiceSpreadPriority(serviceLister algorithm.ServiceLister) algorithm.PriorityFunction
- type NodeLabelPrioritizer
- type ServiceAntiAffinity
- type ServiceSpread
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BalancedResourceAllocation ¶
func BalancedResourceAllocation(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)
BalancedResourceAllocation favors nodes with balanced resource usage rate. BalancedResourceAllocation should **NOT** be used alone, and **MUST** be used together with LeastRequestedPriority. It calculates the difference between the cpu and memory fracion of capacity, and prioritizes the host based on how close the two metrics are to each other. Detail: score = 10 - abs(cpuFraction-memoryFraction)*10. The algorithm is partly inspired by: "Wei Huang et al. An Energy Efficient Virtual Machine Placement Algorithm with Balanced Resource Utilization"
func LeastRequestedPriority ¶
func LeastRequestedPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)
LeastRequestedPriority is a priority function that favors nodes with fewer requested resources. It calculates the percentage of memory and CPU requested by pods scheduled on the node, and prioritizes based on the minimum of the average of the fraction of requested to capacity. Details: cpu((capacity - sum(requested)) * 10 / capacity) + memory((capacity - sum(requested)) * 10 / capacity) / 2
func NewNodeLabelPriority ¶
func NewNodeLabelPriority(label string, presence bool) algorithm.PriorityFunction
func NewServiceAntiAffinityPriority ¶
func NewServiceAntiAffinityPriority(serviceLister algorithm.ServiceLister, label string) algorithm.PriorityFunction
func NewServiceSpreadPriority ¶
func NewServiceSpreadPriority(serviceLister algorithm.ServiceLister) algorithm.PriorityFunction
Types ¶
type NodeLabelPrioritizer ¶
type NodeLabelPrioritizer struct {
// contains filtered or unexported fields
}
func (*NodeLabelPrioritizer) CalculateNodeLabelPriority ¶
func (n *NodeLabelPrioritizer) CalculateNodeLabelPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)
CalculateNodeLabelPriority checks whether a particular label exists on a minion or not, regardless of its value. If presence is true, prioritizes minions that have the specified label, regardless of value. If presence is false, prioritizes minions that do not have the specified label.
type ServiceAntiAffinity ¶
type ServiceAntiAffinity struct {
// contains filtered or unexported fields
}
func (*ServiceAntiAffinity) CalculateAntiAffinityPriority ¶
func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)
CalculateAntiAffinityPriority spreads pods by minimizing the number of pods belonging to the same service on machines with the same value for a particular label. The label to be considered is provided to the struct (ServiceAntiAffinity).
type ServiceSpread ¶
type ServiceSpread struct {
// contains filtered or unexported fields
}
func (*ServiceSpread) CalculateSpreadPriority ¶
func (s *ServiceSpread) CalculateSpreadPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)
CalculateSpreadPriority spreads pods by minimizing the number of pods belonging to the same service on the same machine.