Bug 2056464

Summary: nmstate-webhook pods getting scheduled on the same node
Product: Container Native Virtualization (CNV) Reporter: nijin ashok <nashok>
Component: NetworkingAssignee: Quique Llorente <ellorent>
Status: CLOSED ERRATA QA Contact: Adi Zavalkovsky <azavalko>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.9.2CC: cnv-qe-bugs, kahara, mas-hatada, phoracek, rh-container
Target Milestone: ---   
Target Release: 4.10.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kubernetes-nmstate-handler v4.10.1-3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-18 20:27:03 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:

Description nijin ashok 2022-02-21 10:12:59 UTC
Description of problem:

The nmstate-webhook 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:

nmstate-webhook pods may get scheduled on the same node.

Expected results:

Configure podAntiAffinity on nmstate-webhook so that it will not be scheduled on the same node.

Additional info:

Comment 1 Quique Llorente 2022-03-17 13:55:20 UTC
The u/s fix https://github.com/nmstate/kubernetes-nmstate/pull/1012

Comment 3 Adi Zavalkovsky 2022-04-06 13:32:08 UTC
Verified.
OCP Version 4.10.8
kubernetes-nmstate-handler	v4.10.1-3

nmstate-webhook deployment has topologySpreadConstarints, preventing from pods deploying on the same node.


oc get deployment -n openshift-cnv nmstate-webhook -o yaml
...
      topologySpreadConstraints:
      - labelSelector:
          matchLabels:
            component: kubernetes-nmstate-webhook
        maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule

Comment 9 errata-xmlrpc 2022-05-18 20:27:03 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 Virtualization 4.10.1 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:4668