mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Rebasing onto latest code and fixing issues
This commit is contained in:
parent
c20d062d16
commit
dbac18a909
@ -259,7 +259,7 @@ func (s *ServiceAffinity) CheckServiceAffinity(pod api.Pod, existingPods []api.P
|
|||||||
// just use the first service and get the other pods within the service
|
// just use the first service and get the other pods within the service
|
||||||
// TODO: a separate predicate can be created that tries to handle all services for the pod
|
// TODO: a separate predicate can be created that tries to handle all services for the pod
|
||||||
selector := labels.SelectorFromSet(services[0].Spec.Selector)
|
selector := labels.SelectorFromSet(services[0].Spec.Selector)
|
||||||
servicePods, err := s.podLister.ListPods(selector)
|
servicePods, err := s.podLister.List(selector)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,8 @@ func NewServiceSpreadPriority(serviceLister ServiceLister) PriorityFunction {
|
|||||||
return serviceSpread.CalculateSpreadPriority
|
return serviceSpread.CalculateSpreadPriority
|
||||||
}
|
}
|
||||||
|
|
||||||
// CalculateSpreadPriority spreads pods by minimizing the number of pods on the same machine with the same labels.
|
// CalculateSpreadPriority spreads pods by minimizing the number of pods belonging to the same service
|
||||||
// Importantly, if there are services in the system that span multiple heterogenous sets of pods, this spreading priority
|
// on the same machine.
|
||||||
// may not provide optimal spreading for the members of that Service.
|
|
||||||
func (s *ServiceSpread) CalculateSpreadPriority(pod api.Pod, podLister PodLister, minionLister MinionLister) (HostPriorityList, error) {
|
func (s *ServiceSpread) CalculateSpreadPriority(pod api.Pod, podLister PodLister, minionLister MinionLister) (HostPriorityList, error) {
|
||||||
var maxCount int
|
var maxCount int
|
||||||
var pods []api.Pod
|
var pods []api.Pod
|
||||||
@ -45,7 +44,7 @@ func (s *ServiceSpread) CalculateSpreadPriority(pod api.Pod, podLister PodLister
|
|||||||
// just use the first service and get the other pods within the service
|
// just use the first service and get the other pods within the service
|
||||||
// TODO: a separate predicate can be created that tries to handle all services for the pod
|
// TODO: a separate predicate can be created that tries to handle all services for the pod
|
||||||
selector := labels.SelectorFromSet(services[0].Spec.Selector)
|
selector := labels.SelectorFromSet(services[0].Spec.Selector)
|
||||||
pods, err = podLister.ListPods(selector)
|
pods, err = podLister.List(selector)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -105,7 +104,7 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod api.Pod, podList
|
|||||||
// just use the first service and get the other pods within the service
|
// just use the first service and get the other pods within the service
|
||||||
// TODO: a separate predicate can be created that tries to handle all services for the pod
|
// TODO: a separate predicate can be created that tries to handle all services for the pod
|
||||||
selector := labels.SelectorFromSet(services[0].Spec.Selector)
|
selector := labels.SelectorFromSet(services[0].Spec.Selector)
|
||||||
pods, err = podLister.ListPods(selector)
|
pods, err = podLister.List(selector)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user