-
-
Notifications
You must be signed in to change notification settings - Fork 91
/
values.yaml
76 lines (68 loc) · 3.68 KB
/
values.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# DaskHub configuration values
# ----------------------------
rbac:
enabled: true # Create and use roles and service accounts on an RBAC-enabled cluster.
jupyterhub:
# JupyterHub configuration goes here.
# See https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/master/jupyterhub/values.yaml
hub:
extraConfig:
# Register Dask Gateway service and setup singleuser environment.
00-add-dask-gateway-values: |
# 1. Sets `DASK_GATEWAY__PROXY_ADDRESS` in the singleuser environment.
# 2. Adds the URL for the Dask Gateway JupyterHub service.
import os
# These are set by jupyterhub.
release_name = os.environ["HELM_RELEASE_NAME"]
release_namespace = os.environ["POD_NAMESPACE"]
if "PROXY_HTTP_SERVICE_HOST" in os.environ:
# https is enabled, we want to use the internal http service.
gateway_address = "http://{}:{}/services/dask-gateway/".format(
os.environ["PROXY_HTTP_SERVICE_HOST"],
os.environ["PROXY_HTTP_SERVICE_PORT"],
)
print("Setting DASK_GATEWAY__ADDRESS {} from HTTP service".format(gateway_address))
else:
gateway_address = "http://proxy-public/services/dask-gateway"
print("Setting DASK_GATEWAY__ADDRESS {}".format(gateway_address))
# Internal address to connect to the Dask Gateway.
c.KubeSpawner.environment.setdefault("DASK_GATEWAY__ADDRESS", gateway_address)
# Internal address for the Dask Gateway proxy.
c.KubeSpawner.environment.setdefault("DASK_GATEWAY__PROXY_ADDRESS", "gateway://traefik-{}-dask-gateway.{}:80".format(release_name, release_namespace))
# Relative address for the dashboard link.
c.KubeSpawner.environment.setdefault("DASK_GATEWAY__PUBLIC_ADDRESS", "/services/dask-gateway/")
# Use JupyterHub to authenticate with Dask Gateway.
c.KubeSpawner.environment.setdefault("DASK_GATEWAY__AUTH__TYPE", "jupyterhub")
# Adds Dask Gateway as a JupyterHub service to make the gateway available at
# {HUB_URL}/services/dask-gateway
service_url = "http://traefik-{}-dask-gateway.{}".format(release_name, release_namespace)
for service in c.JupyterHub.services:
if service["name"] == "dask-gateway":
if not service.get("url", None):
print("Adding dask-gateway service URL")
service.setdefault("url", service_url)
break
else:
print("dask-gateway service not found. Did you set jupyterhub.hub.services.dask-gateway.apiToken?")
singleuser:
image:
name: pangeo/base-notebook # Image to use for singleuser environment. Must include dask-gateway.
tag: "2022.08.24"
defaultUrl: "/lab" # Use jupyterlab by defualt.
dask-gateway:
enabled: true # Enabling dask-gateway will install Dask Gateway as a dependency.
# Futher Dask Gateway configuration goes here
# See https://github.com/dask/dask-gateway/blob/master/resources/helm/dask-gateway/values.yaml
gateway:
prefix: "/services/dask-gateway" # Users connect to the Gateway through the JupyterHub service.
auth:
type: jupyterhub # Use JupyterHub to authenticate with Dask Gateway
traefik:
service:
type: ClusterIP # Access Dask Gateway through JupyterHub. To access the Gateway from outside JupyterHub, this must be changed to a `LoadBalancer`.
dask-kubernetes:
# Use dask-kubernetes, rather than Dask Gateway, for creating Dask Clusters.
# Enabling this also requires
# 1. Setting `jupyterhub.singleuser.serviceAccountName: daskkubernetes`.
# 2. Ensuring that `dask-kubernetes` is in your singleuser environment.
enabled: false