User Tools

Site Tools


wiki:aws_vpc_peering

aws vpc peering

If you need to have 2 different vpc-s (from same or a different account) to be able communicate, you need to make sure that their subnets do not overlap otherwise the you will not be able to set up the route tables. General approach is to:

  • Create the peering connection between the 2 subnets

You shouldn't need any special DNS settings to resolve DNS A records in the other vpc, default settings should be ok when creating the peering connection:

  • Create the routes in both VPCs for the respective subnets with the peering connection as a gateway

The routes should be created in the appropriate route table of the subnets, because you may have a default main route table (“rtb-xxx…” below) and a custom route table (“eks-route-table” below) for which you associated the subnets, so you need to create the routes for the custom table

  • Make sure the security groups allow traffic from one subnet to the other

For k8s cluster vpc connections to test it, you can run a pod and try to ping/curl some resource you want to access in another vpc:

kubectl --kubeconfig=test-kubeconfig run test-pod --image=busybox --restart=Never --rm -it -- /bin/sh ping 10.10.10.15

The address 10.10.10.15 is some resource in the second VPC.

Tested on

See also

References

wiki/aws_vpc_peering.txt · Last modified: 2025/03/07 09:09 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki