kubernetesopenshiftopenshift-3openshift-enterprise

What is the concept of Service Affinity in OpenShift?


Situation

When a deployment fails on our OpenShift 3.11 instance because of a Failed Scheduling error event, a message comparable to the following shown:

Failed Scheduling 0/11 nodes are available: 10 CheckServiceAffinity, 2 ExistingPodsAntiAffinityRulesNotMatch, 2 MatchInterPodAffinity, 5 MatchNodeSelector.

In the above error message, the term CheckServiceAffinity is used. While it's easy to find articles on Pod Affinity or Anti-Affinity, I couldn't find a detailed description of Service Affinity.

Question

  1. What is Service Affinity?
  2. Is it a concept of Kubernetes or is it exclusive to OpenShift?

Solution

    1. ServiceAffinity places pods on nodes based on the service running on that pod. Placing pods of the same service on the same or co-located nodes can lead to higher efficiency.

    2. It's a concept of openshift and not of open source kubernetes.

    https://docs.openshift.com/container-platform/3.9/admin_guide/scheduling/scheduler.html#configurable-predicates