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
Copy file name to clipboardExpand all lines: docs/docs/20-admins/30-operation/50-remote.md
+92-15Lines changed: 92 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ flowchart LR
25
25
AmaltheaLocal[Amalthea operator]
26
26
Backend
27
27
end
28
-
28
+
29
29
Backend --> APIA
30
30
APIA --> AmaltheaRemoteA
31
31
AmaltheaRemoteA --> SessionA
@@ -119,10 +119,12 @@ This storage class will be used to provide the working directory of the user ses
119
119
User session scheduling is based on label and taints to select nodes where to run the pod associated with each user session.
120
120
121
121
Labels:
122
+
122
123
- `renku.io/node-purpose: user` User sessions are scheduled only on nodes with this label
123
124
- Extra labels to differentiate node pools as required
124
125
125
126
Taints:
127
+
126
128
- Taints to differentiate node pools as required
127
129
128
130
### Namespace
@@ -218,8 +220,7 @@ data:
218
220
type: kubernetes.io/service-account-token
219
221
```
220
222
221
-
222
-
Now we need to extract these values and format them into a valid `kubeconfig`.
223
+
Now we need to extract these values and format them into a valid `kubeconfig`.
223
224
224
225
```yaml
225
226
apiVersion: v1
@@ -285,13 +286,13 @@ CSI-rClone has to run on every node on the remote cluster where sessions may run
285
286
Therefore you need to make sure you add the correct tolerations in the values file for the
286
287
Helm chart for any taints you may add on nodes intended for user sessions.
287
288
288
-
```bash
289
-
helm install \
290
-
--create-namespace \
291
-
--namespace csi-rclone \
292
-
csi-rclone \
293
-
renku/csi-rclone
294
-
```
289
+
```bash
290
+
helm install \
291
+
--create-namespace \
292
+
--namespace csi-rclone \
293
+
csi-rclone \
294
+
renku/csi-rclone
295
+
```
295
296
296
297
:::note
297
298
The versions of the CSI-rClone between the local and remote clusters must be identical.
@@ -306,12 +307,12 @@ In the previous section we described how to derive the `kubeconfig` for a remote
306
307
That kubeconfig now needs to be added into a dedicated secret in the "local" cluster
307
308
where the backed services will be able to read it and connect to the remote cluster.
308
309
309
-
The name of the secret with all the remote cluster `kubeconfig`s can be found in the Helm chart
310
-
values file at `.dataService.remoteClustersKubeconfigSecretName`.
310
+
The name of the secret with all the remote cluster `kubeconfig`s can be found in the Helm chart
311
+
values file at `.dataService.remoteClustersKubeconfigSecretName`.
311
312
If you do not have this value specified in your Helm chart (by default it is blank).
312
313
Then, you should set the value and upgrade your Helm installation.
313
314
314
-
Here is an example of the `kubeconfig`s secret, assuming the full Renku deployment
315
+
Here is an example of the `kubeconfig`s secret, assuming the full Renku deployment
315
316
runs under the `renku` namespace:
316
317
317
318
```yaml
@@ -351,7 +352,7 @@ for registering the cluster with the API.
351
352
The first step is to define the remote cluster parameters, which are stored using the `/cluster` API endpoint.
352
353
Below is an example payload, assuming `remote-cluster.yaml` is the key of the secret that contains all `Kubeconfig`s
353
354
for the remote clusters. The name of the secret that contains all remote `Kubeconfig`s can be defined at
354
-
`.dataService.remoteClustersKubeconfigSecretName`in the Helm chart values.
355
+
`.dataService.remoteClustersKubeconfigSecretName`in the Helm chart values.
355
356
356
357
Adapt the example below as required.
357
358
@@ -376,6 +377,82 @@ When using `"session_ingress_use_default_cluster_tls_cert": true`,
376
377
_you have to set_ `"session_tls_secret_name": ""` as well, otherwise the API call will fail.
377
378
:::
378
379
380
+
:::note
381
+
If creating the resource pool fails with a message like `Could not find cluster with id XXXXXX in the list of clusters`. This means that you either got the cluster ID wrong or you need to restart the `data_service`, `k8s_watcher` and `data_tasks` services after you have added a new kubeconfig to the kubeconfigs secret.
382
+
:::
383
+
384
+
### Security considerations
385
+
386
+
Renku sessions are embedded in an iframe. And when you run the session on a remote cluster
387
+
then the session hostname is different from the website hostname that hosts the iframe.
388
+
So to make this work we need to set the `SameSite` property on the session cookie to `none`.
389
+
390
+
This raises additional security concerns that should be mitigated as follows on the
391
+
remote cluster ingress configuration.
392
+
393
+
:::note
394
+
It may acceptable to just always open remote sessions in Renku via a separate tab.
395
+
If this is the case then do not set the `SameSite` property to `none` and you do not have
396
+
to implement the additional mitigations discussed below.
Removing or not setting the CORS and CSP headers above can have serious security implications.
453
+
If you are using a different controller make sure you set all equivalent annotations.
454
+
:::
455
+
379
456
### Create a resource pool for the remote cluster
380
457
381
458
Once the cluster connection has been defined, you can use the GET operation to retrieve the cluster connection descriptor, and from there retrieve the associated ULID and create a resource pool which is linked to it.
@@ -442,7 +519,7 @@ https://www.example.org/*
442
519
443
520
### Restart the backend services
444
521
445
-
The `renku-data-service`, `renku-k8s-watcher`, and `renku-secrets-storage` pods need to be
522
+
The `renku-data-service`, `renku-k8s-watcher`, and `renku-secrets-storage` pods need to be
446
523
restarted in order to use the new configuration.
447
524
448
525
As a check, you may watch the logs as each service will announce all the kubeconfigs being loaded as they restart, or during their first remote connections.
0 commit comments