Bug 1996729

Summary: [backport-4.8] Creating a network policy in OVN-Kubernetes can be very inefficient.
Product: OpenShift Container Platform Reporter: Casey Callendrello <cdc>
Component: NetworkingAssignee: Casey Callendrello <cdc>
Networking sub component: ovn-kubernetes QA Contact: Mike Fiedler <mifiedle>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: kholtz, zzhao
Version: 4.8   
Target Milestone: ---   
Target Release: 4.8.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-27 19:53:12 UTC Type: ---
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: 1968569    
Bug Blocks:    

Description Casey Callendrello 2021-08-23 14:28:33 UTC
This bug was initially created as a copy of Bug #1968569

I am copying this bug because: 



Description of problem: When creating a network policy in ovn-kubernetes that selects a lot of pods, it is very inefficient.

This is because it executes multiple (1-4) nbdb transactions for each pod selected by the policy.

We can fix this by being smart and bulk-processing pods on policy creation.


How reproducible: Very


Steps to Reproduce:
1. Create 100-200 pods in a cluster
2. Create a policy that selects those pods
3. Watch to see that it takes 10s of seconds for the policy to take effect

Comment 3 Andrew Stoycos 2021-09-22 18:50:38 UTC
*** Bug 1991621 has been marked as a duplicate of this bug. ***

Comment 4 Mike Fiedler 2021-09-24 15:43:18 UTC
Verified on 4.8.13.   Creating deny and allow policies selecting 1500 pods in a namespace by label takes effect almost instantaneously.  < 2 seconds.

Comment 6 errata-xmlrpc 2021-09-27 19:53:12 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 (OpenShift Container Platform 4.8.13 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/RHBA-2021:3632