IPsec Cross-cluster container network solution
Using IPsec Tunnels for Cross-Cluster Container Network Communication over Public IP
Introduction
Kosmos is a multi-cluster solution, and networking is an essential part of it. Sometimes, there is a need for communication between Kubernetes clusters in different networks. In some cases, two or more clusters can only communicate with each other over the public internet. To address this, Kosmos has implemented a cross-cluster container network communication solution based on IPsec tunnels.
Motivation
For the sake of disaster recovery, application deployments may require communication across different clouds or across regions within a single cloud (across VPCs).
In such scenarios, container communication becomes challenging as the internal IP addresses of the machines are usually not directly accessible without a dedicated network connection.
Common CNI tunnel technologies like VxLAN
or IPIP
may not work effectively in public internet environments.
To solve this problem, Kosmos has implemented a container network communication solution based on IPsec tunnels for cross-cloud communication over the public internet.
This solution addresses the need for communication across public networks while also considering data transmission security.
Goals
The goal is to enable communication between pods in two clusters using elastic public IP addresses. The flow of traffic is illustrated in the diagram below:
This solution does not address container network communication in host network mode within a cluster. Only focuses on IPv4 container network communication and does not cover IPv6 container networks.