You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -189,10 +202,16 @@ Use the `liqoctl network connect --help` command to see all the available option
189
202
## Manual on single cluster
190
203
191
204
When you don't have access to both clusters, or you want to configure it in a declarative way, you can configure it by applying CRDs.
205
+
The process consists of the following steps:
206
+
207
+
1.**Cluster client and server**: the clusters that need to connect have to exchange a `Configuration` resource, containing the `CIDR` of each remote cluster.
208
+
2.**Cluster server**: one of the clusters defines a `GatewayServer`, which exposes a service acting as server for the inter-cluster communication.
209
+
3.**Cluster client**: the other cluster defines a `GatewayClient` resource, which will configure a client that will connect to the gateway server exposed on the other cluster.
210
+
4.**Cluster client and server**: the cluster client and server need to exchange the public keys to allow secure communication.
192
211
193
-
### Configuration CRDs
212
+
### Definition of the network configuration (Configuration CRDs)
194
213
195
-
You need to apply in both clusters the **Configuration** resource:
214
+
In this step, each cluster needs to exchange the network configuration. Therefore, you will need to apply in **both clusters** a `Configuration` resource, paying attention to apply in each cluster, the network configuration of the other one.
196
215
197
216
```yaml
198
217
apiVersion: networking.liqo.io/v1beta1
@@ -208,10 +227,17 @@ spec:
208
227
pod: 10.243.0.0/16 # the pod CIDR of the remote cluster
209
228
```
210
229
211
-
You can find *REMOTE_CLUSTER_ID* these parameters in the output of the `kubectl get configmaps -n liqo liqo-clusterid-configmap --template {{.data.CLUSTER_ID}}` command in the remote cluster.
230
+
You can find *REMOTE_CLUSTER_ID* these parameters in the output of the
231
+
232
+
```bash
233
+
kubectl get configmaps -n liqo liqo-clusterid-configmap \
234
+
--template {{.data.CLUSTER_ID}}
235
+
```
236
+
237
+
command in the remote cluster.
212
238
213
239
```{admonition} Tip
214
-
You can generate this file with the command `liqoctl generate configuration` run in the remote cluster.
240
+
You can generate this file with the command `liqoctl generate configuration` executed in the remote cluster.
215
241
```
216
242
217
243
```{important}
@@ -220,16 +246,17 @@ You need to apply this resource in both clusters.
220
246
221
247
### Gateway CRDs
222
248
223
-
#### Gateway Server
249
+
#### Creation of a gateway server
224
250
225
-
Now, in the cluster that will expose the service and act as a server, you need to apply the **GatewayServer** resource:
251
+
In the inter-cluster communication, one of the clusters will expose a gateway server, where a client on the other cluster will connect to.
252
+
Therefore, in the cluster that will expose the service and act as a server, you need to apply the `GatewayServer` resource:
226
253
227
254
```yaml
228
255
apiVersion: networking.liqo.io/v1beta1
229
256
kind: GatewayServer
230
257
metadata:
231
258
labels:
232
-
liqo.io/remote-cluster-id: <REMOTE_CLUSTER_ID> # the remote cluster ID
259
+
liqo.io/remote-cluster-id: <CLIENT_CLUSTER_ID> # the remote cluster ID
233
260
name: server
234
261
spec:
235
262
endpoint:
@@ -247,12 +274,13 @@ spec:
247
274
You can generate this file with the following command, and then edit it:
248
275
249
276
```bash
250
-
liqoctl create gatewayserver server --remote-cluster-id <REMOTE_CLUSTER_ID> \
277
+
liqoctl create gatewayserver server \
278
+
--remote-cluster-id <CLIENT_CLUSTER_ID> \
251
279
--service-type NodePort -o yaml
252
280
```
253
281
````
254
282
255
-
Some seconds after you will find an assigned IP and a port in the status of the GatewayServer resource:
283
+
After some seconds, you will be able to see an IP address and a port assigned to the GatewayServer resource:
256
284
257
285
```bash
258
286
kubectl get gatewayservers.networking.liqo.io -A
@@ -271,17 +299,18 @@ kubectl get gatewayservers --template {{.status.endpoint}}
Now, in the cluster that will connect to the service and act as a client, you need to apply the **GatewayClient** resource:
304
+
The other cluster will need to connect to the gateway server and act as a client.
305
+
To configure the client, you need to apply the GatewayClient resource, containing the IP address and port where the `GatewayServer` is reachable and all the parameters required for the connection to the server:
277
306
278
307
```yaml
279
308
apiVersion: networking.liqo.io/v1beta1
280
309
kind: GatewayClient
281
310
metadata:
282
311
creationTimestamp: null
283
312
labels:
284
-
liqo.io/remote-cluster-id: <REMOTE_CLUSTER_ID> # the remote cluster ID
313
+
liqo.io/remote-cluster-id: <SERVER_CLUSTER_ID> # the remote cluster ID
285
314
name: client
286
315
namespace: default
287
316
spec:
@@ -304,14 +333,14 @@ The *REMOTE_IP* and *REMOTE_PORT* are the IP and the port of the GatewayServer s
Finally, you need to exchange the **public keys** between the two clusters.
343
+
Finally, to allow secure communication between the clusters, they need to generate a key pair and exchange the **public key**.
315
344
316
345
In the client cluster, you will run the following command:
317
346
@@ -327,9 +356,9 @@ kind: PublicKey
327
356
metadata:
328
357
creationTimestamp: null
329
358
labels:
330
-
liqo.io/remote-cluster-id: <REMOTE_CLUSTER_ID> # the remote cluster ID
359
+
liqo.io/remote-cluster-id: <CLIENT_CLUSTER_ID> # the remote cluster ID
331
360
networking.liqo.io/gateway-resource: "true"
332
-
name: dry-paper
361
+
name: <CLIENT_CLUSTER_ID>
333
362
spec:
334
363
publicKey: <PUBLIC_KEY>
335
364
```
@@ -350,9 +379,9 @@ kind: PublicKey
350
379
metadata:
351
380
creationTimestamp: null
352
381
labels:
353
-
liqo.io/remote-cluster-id: <REMOTE_CLUSTER_ID> # the remote cluster ID
382
+
liqo.io/remote-cluster-id: <SERVER_CLUSTER_ID> # the remote cluster ID
354
383
networking.liqo.io/gateway-resource: "true"
355
-
name: crimson-field
384
+
name: <SERVER_CLUSTER_ID>
356
385
spec:
357
386
publicKey: <PUBLIC_KEY>
358
387
```
@@ -373,83 +402,78 @@ On the server cluster, you will see:
373
402
374
403
```text
375
404
NAMESPACE NAME TYPE STATUS AGE
376
-
default <REMOTE_CLUSTER_ID> Server Connected 2m
405
+
default <CLIENT_CLUSTER_ID> Server Connected 2m
377
406
```
378
407
379
408
On the client cluster, you will see:
380
409
381
410
```text
382
411
NAMESPACE NAME TYPE STATUS AGE
383
-
default <REMOTE_CLUSTER_ID> Client Connected 2m
412
+
default <SERVER_CLUSTER_ID> Client Connected 2m
384
413
```
385
414
386
415
### Summary
387
416
388
-
Resuming, you can implement the network connectivity between two clusters with these steps:
417
+
Resuming, these are the steps to be followed by the administrators of each of the clusters to manually complete the configuration of the inter-cluster network:
389
418
390
-
Export the kubeconfigs environment variables:
419
+
1.**Cluster client**: creates the configuration to be given to the **cluster server** administrator:
391
420
392
-
```bash
393
-
export KUBE_SERVER=PATH_TO_CLUSTER_1_KUBECONFIG
394
-
export KUBE_CLIENT=PATH_TO_CLUSTER_2_KUBECONFIG
395
-
```
421
+
```bash
422
+
liqoctl generate configuration > conf-client.yaml
423
+
```
396
424
397
-
Create the Configuration resources and apply them:
425
+
2.**Cluster server**: applies the client configuration and generates its own to be applied by the **cluster client**:
0 commit comments