I'm facing an issue on my local cluster trying to scope NetworkPolicies to containers instead of pods.
Example: I have a pod with 2 containers.
container-1: a microservice container with HTTP_PROXY, HTTPS_PROXY set to localhost:8008 container-2: an nginx listening on 8008 intercepting outbound requests from container-1 and redirecting them to another service running on port 6000 inside my cluster. That service returns a response, and if it's a 200, then I should allow that original request to hit another service on port 4000.
I do have a NetworkPolicy created that allows my pod to access another pods on port 4000 and 6000 (egress).
The problem is that that policy applies for both containers. I would like to isolate container-1 and apply that networkpolicy only to container-2.
Is that possible?