diff --git a/docs/_static/images/advanced/ipremap/ipremap.drawio.svg b/docs/_static/images/advanced/ipremap/ipremap.drawio.svg new file mode 100644 index 0000000000..f1872527bc --- /dev/null +++ b/docs/_static/images/advanced/ipremap/ipremap.drawio.svg @@ -0,0 +1,126 @@ + + + + + + + + +
+
+
+ + Cluster 1 + +
+
+
+
+ + Cluster 1 + +
+
+ + + + + + + + + + + + + + + +
+
+
+ + Cluster 2 + +
+
+
+
+ + Cluster 2 + +
+
+ + + + + + + + + + +
+
+
+ + External Host + +
+
+
+
+ + External Host + +
+
+ + + + +
+
+
+ + Gateway + +
+
+
+
+ + Gateway + +
+
+ + + + +
+
+
+ + Gateway + +
+
+
+
+ + Gateway + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file diff --git a/docs/_toc.yml b/docs/_toc.yml index abd37bc917..a27b507fc5 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -48,6 +48,7 @@ subtrees: - file: advanced/virtualnode-customizations.md - file: advanced/kubernetes-api.md - file: advanced/nat.md + - file: advanced/external-ip-remapping.md - caption: Contributing entries: diff --git a/docs/advanced/external-ip-remapping.md b/docs/advanced/external-ip-remapping.md new file mode 100644 index 0000000000..f684c935f7 --- /dev/null +++ b/docs/advanced/external-ip-remapping.md @@ -0,0 +1,114 @@ +# External IP remapping + +You can use Liqo to map external IPs and make them reachable from a peered cluster. You can configure the external IP remapping using the **IP** CRD. +This can be useful if you want to make a server (for example a legacy database) running outside the cluster, reachable from a peered cluster. + +```{warning} +This feature is available only if [network module](/advanced/manual-peering.md) is enabled. +``` + +Check the figure below to understand how the external IP remapping works. +We are going to make the **external host** reachable from **cluster 1**. + +```{figure} /_static/images/advanced/ipremap/ipremap.drawio.svg +--- +align: center +--- +Remap External IPs +``` + +## Forge an IP CRD + +The IP CRD allows you to remap an external IP to a new IP belonging to the **External CIDR**. + +Export the kubeconfig file of **cluster 2**: + +```bash +export KUBECONFIG=./cluster2-kubeconfig +``` + +First of all, you need to create a file called **ip.yaml**. + +```yaml +apiVersion: ipam.liqo.io/v1alpha1 +kind: IP +metadata: + name: external-ip-remap +spec: + ip: +``` + +Replace `` with the **external host** you want to map. + +Now, apply the **IP** CRD: + +```bash +kubectl apply -f ip.yaml +``` + +Check the status of the **IP** CRD: + +```bash +kubectl get ip external-ip-remap -o yaml +``` + +If everything went successfully, the status should be similar to the following: + +```yaml +apiVersion: ipam.liqo.io/v1alpha1 +kind: IP +... +status: + ipMappings: + cluster1: + +``` + +The **status** field shows how the **external host** IP has been remapped. +It is an IP belonging to the **External CIDR**. + +We are going to use the **remapped IP** on **cluster 1** to reach the **external host**. + +## Connect to the *external host* + +If **cluster 1** and **cluster 2** have different **External CIDRs** (it can be customized at installation time), you can skip this section and use the IP obtianed in the previous section to reach the **external host**. + +However, in most cases, the **External CIDRs** are the same, we need to get how the **remote external CIDR** has been remapped and *forge* the IP to reach the **external host**. + +First of all, export the kubeconfig file of **cluster 1**: + +```bash +export KUBECONFIG=./cluster1-kubeconfig +``` + +Get the **configuration** CRD for **cluster 2**: + +```bash +kubectl get configuration -n liqo-tenant-cluster2 -o yaml cluster2 +``` + +The output should be similar to the following: + +```yaml +apiVersion: networking.liqo.io/v1beta1 +kind: Configuration +metadata: + labels: + configuration.liqo.io/configured: "true" + liqo.io/remote-cluster-id: cluster2 + name: cluster2 + namespace: liqo-tenant-cluster2 +spec: +... +status: + remote: + cidr: + external: + pod: +``` + +Let's focus on the `REMAPPED_EXT_CIDR` value. Keep the *prefix* of that CIDR and replace it inside the `REMAPPED_IP` found in the **IP** CRD status (check the previous section). + +For example, if the `REMAPPED_EXT_CIDR` is *10.81.0.0/16* and the `REMAPPED_IP` is *10.70.0.1* the final IP will be *10.81.0.1*. + +Now, you can use the **forged IP** to reach the **external host** from **cluster 1**. diff --git a/docs/usage/prometheus-metrics.md b/docs/usage/prometheus-metrics.md index 400f3f2625..2ad0a7d838 100644 --- a/docs/usage/prometheus-metrics.md +++ b/docs/usage/prometheus-metrics.md @@ -28,7 +28,12 @@ These metrics are available for each peered remote cluster, providing statistics We provide a {download}`sample Grafana dashboard ` to monitor the network interconnection of an arbitrary number of Liqo peerings. As presented in the screenshot below, it includes an overview section presenting the overall cross-cluster throughput, followed by detailed per-peering throughput and latency information. -![Grafana Network Dashboard](/_static/images/usage/prometheus-metrics/network-dashboard.png) +```{figure} /_static/images/usage/prometheus-metrics/network-dashboard.png +--- +align: center +--- +Grafana Network Dashboard +``` ## Virtual kubelet metrics @@ -43,4 +48,9 @@ We offer a {download}`sample Grafana dashboard