Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-13859

Deploy pod of the deployment config is not following the configured node affinity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Can't Do
    • Icon: Undefined Undefined
    • None
    • 4.9.z
    • None
    • Important
    • No
    • 2
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Deploy pod of the deployment config is not following the configured node affinity

      Version-Release number of selected component (if applicable):

      Currently tested on 4.9

      How reproducible:

      Yes

      Steps to Reproduce:

      1. Create deployment config with node affinity configured, like below
      
      ~~~
      apiVersion: v1
      kind: DeploymentConfig
      metadata:
        name: http
      spec:
        replicas: 4
        selector:
          app: http
        template:
          metadata:
            name: http
            labels:
              app: http
          spec:
            containers:
            - name: mysql
              image: registry.redhat.io/rhel8/httpd-24@sha256:27fb11a99c2e853e795b8f22fdd13401bbb1c4ee4c749b5e8fa740307a14c002
              ports:
                - containerPort: 8080
                  name: httpd
            affinity:
              nodeAffinity:
                requiredDuringSchedulingIgnoredDuringExecution:
                  nodeSelectorTerms:
                    - matchExpressions:
                      - key: affinity
                        operator: In
                        values:
                        - worker1
      strategy:
        type: Rolling
      
      ~~~
      
      2. Configure the label "affinity=worker1" only to one worker node
      3. Deploy the deploymentconfig
      4. Monitor the pod placement. You could see that replicas are scheduled on the node where the label "affinity=worker1" present but the deploy pod of this DC randomly picking the nodes ( not following the node affinity)

      Actual results:

      Deploy pods are not getting scheduled based on node affinity

      Expected results:

      Deploy pod also should follow the node affinity

      Additional info:

       

            rhn-support-stk Subhashini T K
            rhn-support-amuhamme MUHAMMED ASLAM V K
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: