Foreign Cluster Connector is a Kubebuilder-based Liqo feature that runs in the central Liqo cluster and manages a direct network connection between two foreign clusters.
This proof-of-concept controller watches a ForeignClusterConnection CR in the central cluster and:
- On Create: establishes a direct Liqo tunnel between two specified leaf clusters.
- On Delete: gracefully tears down only that tunnel, preserving all other Liqo network configurations.
- Native Liqo Integration: Adds a
ForeignClusterConnectionCRD and controller logic to Liqo. - Automated Tenant Namespaces: Creates
liqo-tenant-<clusterID>namespaces to isolate per-connection resources. - Selective Teardown: Uses finalizers to disconnect a single peering without impacting others.
- Declarative Workflow: Entire lifecycle managed by applying or deleting one CR.
- Optimized Multi-Cluster Traffic: Leaf clusters communicate directly, avoiding double-hop through the central control-plane.
- Scoped Impact: Only the targeted peering link is modified, preserving all other Liqo-managed tunnels.
- Kubernetes-Native: Fully declarative via Liqo CRDs and finalizers—fits seamlessly into GitOps workflows.
- Centralized Awareness: Central cluster gains visibility into direct leaf-to-leaf connections without altering global routing.
- Future-Proof Foundation: Lays groundwork for conditional IP propagation and dynamic routing optimizations.
- Automation & Simplification: Eliminates manual tracking of cluster-to-cluster network shortcuts.
- Improved Network Coherence: Ensures consistent CIDR remapping and avoids configuration drift.
Building on this, future enhancements could include:
- Conditional IP Propagation: IPAM and virtual-kubelet can choose direct IP propagation when a
ForeignClusterConnectionexists, instead of indirect paths through the central cluster. - Dynamic Routing Optimization: Allow Liqo’s routing logic to prefer direct leaf-to-leaf tunnels over indirect overlays, further reducing latency and load.
Note:
This controller has been tested with thereplicated-deploymentexample from Liqo using Cilium as the CNI, sinceliqoctl disconnect/resetcommands had known issues with the default Kindnet. We recommend testing it in the same context to verify its functionality.
- Go v1.23.0+
- Docker 17.03+
kubectlv1.11.3+- Access to a Kubernetes cluster v1.11.3+
make installApply the clusterrole.yaml file in each leaf cluster to grant the controller the necessary permissions to create the required components.
kubectl apply -f clusterrole.yaml \ --kubeconfig /path/to/foreign/kubeconfig
⚠️ This is a temporary setup intended for testing purposes only. A proper ServiceAccount with the necessary ClusterRole and ClusterRoleBinding should be configured for production use.
⚠️ If a non-default setup is used, ensure that thesubjectsfield in theClusterRoleBindingis updated to reference the correct ServiceAccount, User, or Group of the main cluster.
make deploykubectl apply -f shortcutExample.yamlkubectl delete fcc europe-rome-edge-europe-milan-edgemake uninstallmake undeploy