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: mkdocs/docs/concepts/backends.md
+99-21Lines changed: 99 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -918,6 +918,26 @@ projects:
918
918
919
919
</div>
920
920
921
+
### JarvisLabs
922
+
923
+
Log into your [JarvisLabs](https://cloud.jarvislabs.ai/) account and create an API key.
924
+
925
+
Then, go ahead and configure the backend:
926
+
927
+
<div editor-title="~/.dstack/server/config.yml">
928
+
929
+
```yaml
930
+
projects:
931
+
- name: main
932
+
backends:
933
+
- type: jarvislabs
934
+
creds:
935
+
type: api_key
936
+
api_key: ...
937
+
```
938
+
939
+
</div>
940
+
921
941
### CloudRift
922
942
923
943
Log into your [CloudRift](https://console.cloudrift.ai/) console, click `API Keys` in the sidebar and click the button to create a new API key.
@@ -1051,9 +1071,9 @@ Compared to [VM-based](#vm-based) backends, they offer less fine-grained control
1051
1071
1052
1072
### Kubernetes
1053
1073
1054
-
Regardless of whether it’s on-prem Kubernetes or managed, `dstack` can orchestrate container-based runs across your clusters.
1074
+
Regardless of whether it’s on-prem Kubernetes or managed, `dstack` can orchestrate container-based runs across your clusters. A single `kubernetes` backend can manage one or many clusters — each cluster is selected via a kubeconfig [context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context).
1055
1075
1056
-
To use the `kubernetes` backend with `dstack`, you need to configure it with the path to the kubeconfig file, the IP address of any node in the cluster, and the port that `dstack` will use for proxying SSH traffic.
1076
+
The recommended way is to enable clusters explicitly via the `contexts` property:
1057
1077
1058
1078
<div editor-title="~/.dstack/server/config.yml">
1059
1079
@@ -1066,22 +1086,48 @@ projects:
1066
1086
kubeconfig:
1067
1087
filename: ~/.kube/config
1068
1088
1069
-
proxy_jump:
1070
-
hostname: 204.12.171.137
1071
-
port: 32000
1089
+
contexts:
1090
+
- name: gpu-cluster-a
1091
+
- name: gpu-cluster-b
1072
1092
```
1073
1093
1074
1094
</div>
1075
1095
1076
1096
!!! info "Proxy jump"
1077
-
To allow the `dstack` server and CLI to access runs via SSH, `dstack` requires a node that acts as a jump host to proxy SSH traffic into containers.
1097
+
To allow the `dstack` server and CLI to access runs via SSH, `dstack` uses a node in each cluster as a jump host to proxy SSH traffic into containers. No additional setup is required — `dstack` configures and manages the proxy automatically.
1098
+
1099
+
By default, `dstack` autodetects the jump host:
1100
+
1101
+
- `hostname`— picks the `ExternalIP` of the jump pod's node, or a random node `ExternalIP` from the cluster if the jump pod's node has none. If no node in the cluster has an `ExternalIP`, provisioning fails and you must set `hostname` explicitly.
1102
+
- `port`— Kubernetes allocates a port from the cluster's NodePort range.
1103
+
1104
+
Set `proxy_jump.hostname` and `proxy_jump.port` per context to override autodetection — useful when nodes lack `ExternalIP`s, or when you want a stable, firewall-friendly port:
1105
+
1106
+
```yaml
1107
+
contexts:
1108
+
- name: gpu-cluster-a
1109
+
proxy_jump:
1110
+
hostname: 204.12.171.137
1111
+
port: 32000
1112
+
```
1113
+
1114
+
Both fields are independent — you can set just one.
1078
1115
1079
-
To configure this node, specify `hostname` and `port` under the `proxy_jump` property:
1116
+
The jump host can be a GPU node or a CPU-only node — it makes no difference. The only requirement is that both the `dstack` server and CLI can reach `hostname:port`.
1080
1117
1081
-
- `hostname`— the IP address of any cluster node selected as the jump host. Both the `dstack` server and CLI must be able to reach it. This node can be either a GPU node or a CPU-only node — it makes no difference.
1082
-
- `port`— any accessible port on that node, which `dstack` uses to forward SSH traffic.
1118
+
!!! info "Region and namespace"
1119
+
Each enabled context becomes its own `dstack` region, named after the context. When creating a `dstack` [volume](volumes.md) or [gateway](gateways.md), the `region` field selects which cluster the resource is provisioned in.
1083
1120
1084
-
No additional setup is required — `dstack` configures and manages the proxy automatically.
1121
+
The namespace `dstack` uses for managed resources is taken from each kubeconfig context's `namespace` property, defaulting to `default` if not set:
1122
+
1123
+
```yaml
1124
+
contexts:
1125
+
- name: gpu-cluster-a
1126
+
context:
1127
+
cluster: gpu-cluster-a
1128
+
user: kubernetes-admin
1129
+
namespace: dstack
1130
+
```
1085
1131
1086
1132
??? info "User interface"
1087
1133
If you are configuring the `kubernetes` backend on the [project settings page](projects.md#backends),
If `contexts` is not set, `dstack` falls back to using the kubeconfig's `current-context` as the only cluster, and the top-level `proxy_jump` and `namespace` properties apply:
1176
+
1177
+
<div editor-title="~/.dstack/server/config.yml">
1178
+
1179
+
```yaml
1180
+
projects:
1181
+
- name: main
1182
+
backends:
1183
+
- type: kubernetes
1184
+
1185
+
kubeconfig:
1186
+
filename: ~/.kube/config
1187
+
1188
+
namespace: dstack
1189
+
1190
+
proxy_jump:
1191
+
hostname: 204.12.171.137
1192
+
port: 32000
1122
1193
```
1123
1194
1124
1195
</div>
1196
+
1197
+
This mode is not recommended and may be deprecated and removed in the future. It also has a namespace-handling quirk: the top-level `namespace` property **overrides** the kubeconfig context's namespace (defaulting to `default` if not set in the config), unlike the `contexts` mode where the kubeconfig is authoritative. A warning is logged when the two disagree. To prepare for a possible future change, set the same value in both your kubeconfig context and the backend config.
1198
+
1199
+
With this configuration, the cluster's region is an empty string. When creating a `dstack` volume or gateway, set `region: ''` explicitly in the configuration.
1200
+
1201
+
!!! warning "Migrating from legacy to `contexts`"
1202
+
Switching an existing backend from the legacy mode to `contexts` is not transparent for already-provisioned resources: their region changes from an empty string to the context name, so `dstack` can no longer terminate them. Terminate all jobs, gateways, and volumes managed by the backend before changing the configuration.
Ensure you've created a ClusterRoleBinding to grant the role to the user or the service account you're using.
1230
+
Ensure you've created a ClusterRoleBinding and RoleBinding to grant the roles to the user or the service account you're using.
1153
1231
1154
1232
??? info "Resources and offers"
1155
1233
If you use ranges with [`resources`](../concepts/tasks.md#resources) (e.g. `gpu: 1..8` or `memory: 64GB..`) in fleet or run configurations, other backends collect and try all offers that satisfy the range.
0 commit comments