Pods communication in kubernetes ingress egress

12/1/2021

If I have two pods running on different namespaces, and there is netpol already setup and cannot be modified, how would I approach the POD to POD communication making the ingress and egress possible again without modifying the existing object?

-- user9356263
kubernetes

1 Answer

12/2/2021

User Vorsprung has good mentioned in the comment:

The netpolicy that is already there probably does a general ingres / egress block. If you add another policy that specifically allows the POD to POD you need then it will, in this case override the general policy. See https://serverfault.com/questions/951958

Yes, you can add another network policy according to your needs and everything should work. It doesn't matter in which order you apply your rules.

Look also here. You can find many kubernetes network policies recipes.

-- Mikołaj Głodziak
Source: StackOverflow