Routing One Pod's packet directly to another Pod

Routing One Pod’s packet to another Pod.

We are trying to deploy a pod hosting IPSec functionality lets say IPsec pod.
This IPsec pod is responsible for encrypting all the packets it receives, in ESP mode and send it to a security gateway inside IPsec tunnel. Any other pods requiring IPsec functionality should be routing their packets directly to this IPsec pod for the sake of tunneling their packets.
We looked into weavenet, flannel, canal CNIs, but we could not come up with the way to realize this requirement.

Any help in this regard is appreciated.

Cluster information:

Kubernetes version: 1.17.0)
Cloud being used: Bare-metal
Installation method:
Host OS: Cent OS-7
CNI and version: flannel (latest)
CRI and version: Docker 1.13.1

Regards,
Shubham

Can anyone please check this and suggest whether this is possible or not. I am struggling from couple of days to figure this out.

There isn’t a kubernetes API for this. If there’s a way to do it, it’s below Kubernetes.

1 Like

Thanks! Is istio a possible solution for the same?

Istio is certainly more programmable, but I don’t know for sure if it can express what you are trying to say here.