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
*** Bug 1991621 has been marked as a duplicate of this bug. ***
Verified on 4.8.13. Creating deny and allow policies selecting 1500 pods in a namespace by label takes effect almost instantaneously. < 2 seconds.
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.