Score:0

Best way to add static routes to every pod in a Kubernetes cluster?

bd flag

I have 3 nodes running several OpenVPN pods, each pod has a VPN network of 100.70.0.0/16, and clients that connect to these pods receive IP addresses in this range, for example, let's say that client 100.70.162.91 connected to one of the pods.

Now, I want to add more pods running different services on this cluster, and each pod must be able to talk to every VPN client. One of the big steps of the way I would do this so far, using AWS ECS, is adding a route such as ip route add 100.70.192.91/32 via <OpenVPN-pod-IPv4>/32 on the cluster VPC's subnet route table once a client connects using the AWS API, this method does seem to also work using docker-compose and Kubernetes as long as all the pods are on the same network.

However, now that I am trying to migrate from ECS to Kubernetes, I cannot seem to find any way to add cluster-wide network static routes on Kubernetes.

What would be the best way to implement this on Kubernetes?

paladin avatar
id flag
Don't do this. Use [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) or equal reverse proxy programs.
Score:0
gi flag

if your use the vanilla k8s instead of ECS you have an option to add such routes on worker nodes. So pod traffic to non-k8s (VPN clients network is differ from k8s pods net) networks would egress via worker nodes routing table. You need add static route to VPN clients network on worker nodes. The route destination you set vpn-pod IP. It is accessible from any k8s worker node.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.