mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-22 18:16:52 +00:00
Added a more formal comment for the service affinity predicate
This commit is contained in:
parent
6fd0b181e3
commit
40df5f6db8
@ -231,6 +231,11 @@ func NewServiceAffinityPredicate(podLister PodLister, serviceLister ServiceListe
|
|||||||
// The set of labels to be considered are provided to the struct (ServiceAffinity).
|
// The set of labels to be considered are provided to the struct (ServiceAffinity).
|
||||||
// The pod is checked for the labels and any missing labels are then checked in the minion
|
// The pod is checked for the labels and any missing labels are then checked in the minion
|
||||||
// that hosts the service pods (peers) for the given pod.
|
// that hosts the service pods (peers) for the given pod.
|
||||||
|
//
|
||||||
|
// We add an implicit selector requiring some particular value V for label L to a pod, if:
|
||||||
|
// - L is listed in the ServiceAffinity object that is passed into the function
|
||||||
|
// - the pod does not have any NodeSelector for L
|
||||||
|
// - some other pod from the same service is already scheduled onto a minion that has value V for label L
|
||||||
func (s *ServiceAffinity) CheckServiceAffinity(pod api.Pod, existingPods []api.Pod, node string) (bool, error) {
|
func (s *ServiceAffinity) CheckServiceAffinity(pod api.Pod, existingPods []api.Pod, node string) (bool, error) {
|
||||||
var affinitySelector labels.Selector
|
var affinitySelector labels.Selector
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user