Bug 1975392 - Console and downloads pods should have more specific anti-affinity label selectors
Summary: Console and downloads pods should have more specific anti-affinity label sele...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.9.0
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-23 15:08 UTC by Samuel Padgett
Modified: 2021-10-18 17:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Version: 4.9.0-0.nightly-2021-06-22-193627 Cluster ID: 0b2af0aa-9f64-4e6c-82f3-07898d29db50 Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0
Last Closed: 2021-10-18 17:36:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console-operator pull 560 0 None open Bug 1975379: Use hard requirement for anti-affinity rules on both console's deployments 2021-06-24 16:48:36 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:36:42 UTC

Description Samuel Padgett 2021-06-23 15:08:30 UTC
Since 4.8, both the console pods and downloads pods in the openshift-console namespace have anti-affinity rules. They both use label selector `app=console`, however, which means that the downloads pods have anti-affinity with the console pods and vice versa. We should have more specific selectors so that downloads pods only have anti-affinity with other downloads pods and console pods only have anti-affinity with other console pods.

This will be required if we switch the anti-affinity rules to use a hard requirement `requiredDuringSchedulingIgnoredDuringExecution` rather than the current soft requirement `preferredDuringSchedulingIgnoredDuringExecution` since one of the pods would fail to schedule on a cluster with 3 masters.

Comment 1 Jakub Hadvig 2021-07-02 17:00:08 UTC
Still valid. PR up and in merge process.

Comment 4 Yadan Pei 2021-07-19 03:35:18 UTC
$ oc get deployment console -o json | jq .spec.template.spec.affinity
{
  "podAntiAffinity": {
    "requiredDuringSchedulingIgnoredDuringExecution": [
      {
        "labelSelector": {
          "matchExpressions": [
            {
              "key": "component",
              "operator": "In",
              "values": [
                "ui"
              ]
            }
          ]
        },
        "topologyKey": "kubernetes.io/hostname"
      }
    ]
  }
}


$ oc get deployment downloads -o json | jq .spec.template.spec.affinity
{
  "podAntiAffinity": {
    "requiredDuringSchedulingIgnoredDuringExecution": [
      {
        "labelSelector": {
          "matchExpressions": [
            {
              "key": "component",
              "operator": "In",
              "values": [
                "downloads"
              ]
            }
          ]
        },
        "topologyKey": "kubernetes.io/hostname"
      }
    ]
  }
}

$ oc get pods  --show-labels
NAME                         READY   STATUS    RESTARTS   AGE     LABELS
console-7f9574c678-rjxqr     1/1     Running   0          3h32m   app=console,component=ui,pod-template-hash=7f9574c678
console-7f9574c678-z8kc4     1/1     Running   0          3h32m   app=console,component=ui,pod-template-hash=7f9574c678
downloads-7d9df5cb76-s7fs4   1/1     Running   0          3h34m   app=console,component=downloads,pod-template-hash=7d9df5cb76
downloads-7d9df5cb76-zmhmp   1/1     Running   0          3h34m   app=console,component=downloads,pod-template-hash=7d9df5cb76


download and console pods now have more specific labels "component=downloads/ui",  console and downloads deployment have more precise anti-affinity rules

Verified on 4.9.0-0.nightly-2021-07-18-155939

Comment 7 errata-xmlrpc 2021-10-18 17:36:28 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 (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), 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-2021:3759


Note You need to log in before you can comment on or make changes to this bug.