Use case wanted: support inter-Pod affinity which can be satisfied by one or more Pods

Hi, I’m @sanposhiho from SIG-Scheduling.

We’re considering supporting inter-Pod affinity which can be satisfied by one or more Pods.

With this feature, a pod can have multiple affinity terms satisfied by a group of pods, as opposed to only a single pod. For example:

  • Assume that the cluster has two nodes:

  • nodeA located in in zone1/region1

  • nodeB located in zone2/region1

  • There are two existing pods on these nodes:

  • Pod1:

    • nodeName: “nodeA”
    • label “foo”:“”
  • Pod2:

    • nodeName: “nodeB”
    • label “bar”:“”
  • Pod3 comes in with inter-pod affinity:

    • affinity terms:
      • {label “foo” exists, topologyKey: “region”}
      • {label “bar” exists, topologyKey: "zone”}

With our current (K8s 1.12) implementation, Pod3 is not schedulable, because there is no single pod that satisfies all of its affinity terms. However, if we support multiple pods satisfying the affinity terms, Pod3 can be scheduled on nodeB. Pod1 satisfies the first term of its affinity in region1 and Pod2 satisfies its second term in zone2. So, any node in zone2/region1 will be feasible for Pod3.

But, given the issue has been open for a long time, we want to have some practical use cases to get convinced that it’s a wanted and valuable feature. So, if you have any, please comment on the issue!
Any use cases/feedback would be very much appreciated. Thanks.