Skip to content

Commit

Permalink
Handle https-enabled JupyterHub deployments
Browse files Browse the repository at this point in the history
As discovered in
pangeo-data/pangeo-cloud-federation#697, the
current use of `proxy-public` doesn't work when https is enabled. We
detect this and use the appropriate service now.
  • Loading branch information
TomAugspurger committed Aug 27, 2020
1 parent 212a802 commit 82d6c21
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion daskhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ 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", "http://proxy-public/services/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.
Expand Down

0 comments on commit 82d6c21

Please sign in to comment.