I have a scenario, there are 2 pods web and api. Web should only send traffic to . . .

lal prasad:
I have a scenario, there are 2 pods web and api. Web should only send traffic to api and vice versa. How this kind of restriction can be accomplished with network policy. Is it like for each pods create a ingress and egress rule?

vishnu nair:
you should create network policy from the web pod’s perspective. it should include both ingress and egress rule with api service defined in both of them