Bug 2056467 - virt-template-validator pods getting scheduled on the same node
Summary: virt-template-validator pods getting scheduled on the same node
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.9.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: ffossemo
QA Contact: Akriti Gupta
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-21 10:17 UTC by nijin ashok
Modified: 2023-11-13 08:15 UTC (History)
5 users (show)

Fixed In Version: hco-bundle-registry-container-v4.11.0-315 kubevirt-ssp-operator-v4.11.0-29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-14 19:28:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt ssp-operator pull 319 0 None Merged Add default podAntiAffinity to PodTemplateSpec 2022-03-07 13:03:15 UTC
Red Hat Issue Tracker CNV-16517 0 None None None 2023-11-13 08:15:19 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:29:07 UTC

Description nijin ashok 2022-02-21 10:17:19 UTC
Description of problem:

The virt-template-validator by default is configured with 2 replicas. However, it doesn't have podAntiAffinity configured and the two replicas may get scheduled on the same master node. So if this node goes down, we lose both replicas.

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

version: v4.9.2

How reproducible:

100%

Steps to Reproduce:


Actual results:

virt-template-validator pods may get scheduled on the same node.

Expected results:

Configure podAntiAffinity on virt-template-validator so that it will not be scheduled on the same node.

Additional info:

Comment 1 Akriti Gupta 2022-05-02 07:34:02 UTC
checked with iib:219905

virt-template-validator pods are getting scheduled on different nodes 

"name": "virt-template-validator-7c5bd9985c-d2h47"
"nodeName": "virt-akr-411-jpqfs-worker-0-rt6lf"

"name": "virt-template-validator-7c5bd9985c-cv58q"
"nodeName": "virt-akr-411-jpqfs-worker-0-qtqtv"

also podAntiAffinity is configured 

"spec": {
        "affinity": {
            "podAntiAffinity": {
                "preferredDuringSchedulingIgnoredDuringExecution": [
                    {
                        "podAffinityTerm": {
                            "labelSelector": {
                                "matchExpressions": [
                                    {
                                        "key": "kubevirt.io",
                                        "operator": "In",
                                        "values": [
                                            "virt-template-validator"
                                        ]
                                    }
                                ]
                            },
                            "topologyKey": "kubernetes.io/hostname"
                        },
                        "weight": 1
                    }
                ]
            }
        },

Comment 2 Akriti Gupta 2022-05-02 11:35:44 UTC
(In reply to Akriti Gupta from comment #1)
> checked with iib:219905
> 
> virt-template-validator pods are getting scheduled on different nodes 
> 
> "name": "virt-template-validator-7c5bd9985c-d2h47"
> "nodeName": "virt-akr-411-jpqfs-worker-0-rt6lf"
> 
> "name": "virt-template-validator-7c5bd9985c-cv58q"
> "nodeName": "virt-akr-411-jpqfs-worker-0-qtqtv"
> 
> also podAntiAffinity is configured 
> 
[cnv-qe-jenkins@virt-akr-411-jpqfs-executor ~]$ oc get pods virt-template-validator-7c5bd9985c-d2h47 -n openshift-cnv -o json |jq '.spec.affinity'
{
  "podAntiAffinity": {
    "preferredDuringSchedulingIgnoredDuringExecution": [
      {
        "podAffinityTerm": {
          "labelSelector": {
            "matchExpressions": [
              {
                "key": "kubevirt.io",
                "operator": "In",
                "values": [
                  "virt-template-validator"
                ]
              }
            ]
          },
          "topologyKey": "kubernetes.io/hostname"
        },
        "weight": 1
      }
    ]
  }
}

Comment 4 Akriti Gupta 2022-05-30 10:50:31 UTC
PR for testing virt-template-validator pods are getting scheduled on different nodes is raised here https://code.engineering.redhat.com/gerrit/c/cnv-tests/+/409470

Comment 6 errata-xmlrpc 2022-09-14 19:28:43 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 (Important: OpenShift Virtualization 4.11.0 Images security and bug fix 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-2022:6526


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