-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add routes to all peered VPCs (config option) #24
Conversation
We currently don't use any virtual gateways, however this would be a good addition. I can double check how our network setup looks now (which has gotten more complicated over time, as they do). |
We are relying on the vpc peering feature and in our case it's enough because we don't have VPNs configured (yet?) and we add the peering routes to all our pod subnets. I was wondering if an alternative could be to use the ipvlan interface as the default route and only send explicit traffic through the PTP one:
The advantage would be that most traffic would go through the IPVLAN interface but it would not allow for nodes with public IPs (today traffic outside the VPC and peers is masqueraded on the primary interface). |
I've thought about the same, it may make sense to also have the option of just supplying a list of routes in the config file. The reason the default route must go through the host is that in a public subnet, only a private ip with a public ip assigned to it is able to reach the internet. In a private subnet, that is unnecessary though. That said, there is an easy alternative for public subnets... since there are just 3 private ip ranges, you can set a route for each over the ipvlan interface via the subnet gateway: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and then keep your default route pointed at the host. I was using this strategy before I started using this CNI plugin so I wouldn't need so many rules and it's resilient to subnet changes (if you bring a new vpc online, you shouldn't have to roll every pod). The one expectation it breaks is for people who have configured explicit routes for internet ip ranges in their aws route tables, which isn't that common, but has valid use cases. That said, I think the automatic configuration via the routing table is a sane enough auto configuring feature, but the only way to handle every use case would be making the list of routes configurable. |
If the key
routeToVpcPeers
is set totrue
on the IPAMconfiguration, all known peered VPC CIDRs will be added to the IPvlan
route table allowing for direct VPC<->VPC communication.
Fixes #21 / #23