<p>Currently, I'm running a Kubernetes cluster on GCloud K8s Engine.</p>

<p>Now I'm running an OpenVPN Server on there to create a network where multiple clients can talk together in a client-to-client fashion.
If I'm using just a single VPN server it also already works. The client can connect to the K8s Pod and communicate with other clients or even the server itself.</p>

<p>However now I want to make that a little bit more available and want to have at least two servers which means I create another VPN network, which is relatively simple, by using the same configuration I used in server1 (I just need to adjust the Subnet).</p>

<p>But the tricky part is how can I make it happen that both pods can correctly route the networks?</p>

<p>i.e. I have the VPN networks <code>172.40.0.0/16</code> (Pod 1) and <code>172.41.0.0/16</code> (Pod 2).
Does K8s or GCloud have any way of announcing the VPN network so that the pods will correctly route requests from <code>172.40.0.0/16</code> to <code>172.41.0.0/16</code></p>

<p>(OpenVPN will have both routes pushed to the client, so either Pod 1 will be the gateway or Pod 2)</p>

<p>I wouldn't bother writing code so that I can correctly communicate with the pods i.e. if I create a GCloud Route with the POD IP as a gateway with the networks would that work?</p>

Christian Schmitt
<blockquote>
  <p>Does K8s or GCloud have any way of announcing the VPN network so that the pods will correctly route requests from 172.40.0.0/16 to 172.41.0.0/16</p>
</blockquote>

<p>Kubernetes doesn't have any such mechanisms. However, you could look at <a href="https://docs.projectcalico.org/v2.0/usage/configuration/bgp" rel="nofollow noreferrer">BGP peering</a> with <a href="https://docs.projectcalico.org/v2.0/getting-started/kubernetes/installation/" rel="nofollow noreferrer">Calico</a> as an overlay.</p>

<p>The other option I guess is to create manual routes on both servers that point to each other that way traffic flows both ways. Traffic to the PodCidr is gonna be trickier because it's generally masqueraded with <a href="https://en.wikipedia.org/wiki/Iptables" rel="nofollow noreferrer">iptables</a> and in a Kubernetes cluster the PodCidr is cluster-wide.</p>
