Bug 1492194

Summary: [3.5] Node affinity alpha feature can cause scheduling failures across the cluster.
Product: OpenShift Container Platform Reporter: Seth Jennings <sjenning>
Component: NodeAssignee: ravig <rgudimet>
Status: CLOSED ERRATA QA Contact: Weihua Meng <wmeng>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: aos-bugs, decarr, jokerman, mmccomas, rgudimet, rhowe, sjenning, wmeng
Target Milestone: ---   
Target Release: 3.5.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: As of now, pod anti-affinity is respected across projects. Consequence: podA from project1 won't land on node where podB from project2 is running, if pod anti-affinity is enabled when scheduling pod A. Fix: While scheduling podA check for pod anti-affinity only within the project of podA. Result: pod anti-affinity won't be respected across projects.
Story Points: ---
Clone Of: 1483119 Environment:
Last Closed: 2017-12-07 07:11:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1483119    
Bug Blocks:    

Comment 1 Seth Jennings 2017-09-15 17:49:50 UTC
OSE PR:
https://github.com/openshift/ose/pull/860

Comment 4 Weihua Meng 2017-10-05 12:53:12 UTC
Not fixed in errata version (atomic-openshift-3.5.5.31.27-1.git.0.5d19d76.el7)
  or latest 3.5 (v3.5.5.31.29)

Comment 5 ravig 2017-10-05 14:15:05 UTC
Weiha Meng,

None of those builds have my changes. The PR got merged 6 days ago and I couldn't find a release for 3.5 after that. 

Also, the pod.yaml needs to change for the testing as pod-affinity and anti-affinity are in annotations rather than in pod spec for 3.5.

Comment 6 Seth Jennings 2017-10-05 14:44:20 UTC
Looks like the errata tool may have mistakenly moved this to ON_QA.  Moving back to MODIFIED until it is actually in a build.

Comment 8 Weihua Meng 2017-10-13 01:28:21 UTC
NOT fixed.
openshift v3.5.5.31.34

Comment 9 ravig 2017-10-13 02:15:58 UTC
Can you please share the pod.yaml that was used for testing?

Comment 10 Weihua Meng 2017-10-13 02:18:09 UTC
# cat deployment-sample.yaml 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
    name: sample1
spec:
  replicas: 2
  template:
    metadata:
      labels:
          app: sample
      annotations:
        scheduler.alpha.kubernetes.io/affinity: >
          {
            "podAntiAffinity": {
              "requiredDuringSchedulingIgnoredDuringExecution": [
                {
                  "labelSelector": {
                    "matchExpressions": [
                      {
                        "key": "app",
                        "operator": "In",
                        "values": ["sample"]
                      }
                    ]
                  },
                  "topologyKey": "kubernetes.io/hostname"
                }
              ]
            }
          }
    spec:
      containers:
      - name: sam
        image: docker.io/ocpqe/hello-pod

Comment 15 ravig 2017-10-13 02:50:19 UTC
Thanks Weihua Meng, I will check this.

Comment 19 Weihua Meng 2017-10-25 05:29:14 UTC
Verified on openshift v3.5.5.31.39
Fixed.

Comment 22 errata-xmlrpc 2017-12-07 07:11:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:3389