Route specific subnet traffic beween application and devices connected through a management VPN tunnel

Given two pods deployed on different nodes:

  1. myapp pod deployed on apps node
  2. wireguard pod deployed on vpn node, using a subnet like

I need myapp to be able to be able to route traffic to the wireguard peers (VPN clients) having IPs in the subnet, the traffic is mostly ICMP probes, SSH and iperf tests.

I already enabled IP forwarding on the wireguard pode and VPN node, now I need to understand: how do I set up routes in a way that plays nicely with the Kubernetes networking model?

That is, I want to instruct the myapp pods to send traffic for the subnet used by wireguard ( to the wireguard container so that the traffic is routed to the VPN clients.

Is the problem clear?

Cluster information:

Kubernetes version: 1.23
Cloud being used: Linode / Vultr / Bare metal

1 Like

were you able to find a solution for this? I have something similiar of a problem, wondering how to solve this problem?

DId you find any reasonable solution? I am doing the same use case, and I am interested in how you solve it.