{"modulePath":"github.com/dockerstack/kubernetes","version":"v0.20.1-0.20150627061651-1c0b765df6da","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package priorities\n\n## Functions\n\n```go\nfunc BalancedResourceAllocation(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)\n```\nBalancedResourceAllocation 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\"\n\n```go\nfunc LeastRequestedPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)\n```\nLeastRequestedPriority 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: (Sum(requested cpu) / Capacity + Sum(requested memory) / Capacity) \\* 50\n\n```go\nfunc NewNodeLabelPriority(label string, presence bool) algorithm.PriorityFunction\n```\n\n```go\nfunc NewServiceAntiAffinityPriority(serviceLister algorithm.ServiceLister, label string) algorithm.PriorityFunction\n```\n\n```go\nfunc NewServiceSpreadPriority(serviceLister algorithm.ServiceLister) algorithm.PriorityFunction\n```\n\n## Types\n\n```go\ntype NodeLabelPrioritizer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (n *NodeLabelPrioritizer) CalculateNodeLabelPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)\n```\nCalculateNodeLabelPriority 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.\n\n```go\ntype ServiceAntiAffinity struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)\n```\nCalculateAntiAffinityPriority 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).\n\n```go\ntype ServiceSpread struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *ServiceSpread) CalculateSpreadPriority(pod *api.Pod, podLister algorithm.PodLister, minionLister algorithm.MinionLister) (algorithm.HostPriorityList, error)\n```\nCalculateSpreadPriority spreads pods by minimizing the number of pods belonging to the same service on the same machine.\n\n","path":"github.com/dockerstack/kubernetes/plugin/pkg/scheduler/algorithm/priorities","name":"priorities","synopsis":"","isRedistributable":true}
