can not connect to AKS daskhub

86 views Asked by At

I followed this readme to deploy dusk on my AKS test cluster:

helm values changes:

  • set the api token
  • changed traefik to load banacher
  • gateway.prefix: "/services/dask-gateway"

ended up with this services in aks:

api-test-dask-gateway             ClusterIP      10.0.xxx.yyy    <none>           8000/TCP       2d2h
hub                               ClusterIP      10.0.xxx.yyy    <none>           8081/TCP       2d2h
proxy-api                         ClusterIP      10.0.xxx.yyy    <none>           8001/TCP       2d2h
proxy-public                      LoadBalancer   10.0.xxx.yyy    ii.jjj.kkk.lll   80:31766/TCP   2d2h
traefik-test-dask-gateway         LoadBalancer   10.0.xxx.yyy    aa.bbb.ccc.ddd   80:32032/TCP   2d2h

Witch worked I can login into the jupiter notebook and all good

Now I am trying to connect to it from my local pc and I found very little information on that

I tried this:

import os
from dask_gateway import Gateway
os.environ['JUPYTERHUB_API_TOKEN'] = "abcde"
gateway = Gateway(
    address="http://ii.jjj.kkk.lll/services/dask-gateway",
    auth="jupyterhub"
)
gateway.list_clusters()

the error that I get is 404

<div class="error">

  <h1>
    404 : Not Found
  </h1>


<p>Jupyter has lots of moons, but this is not one...</p>

</div>

also tried this:

import os
from dask_gateway import Gateway
os.environ['JUPYTERHUB_API_TOKEN'] = "abcde"
gateway = Gateway(
    address="http://ii.jjj.kkk.lll/services/dask-gateway",
    proxy_address="gateway://aa.bbb.ccc.ddd:80",
    auth="jupyterhub"
)
gateway.list_clusters()

got the same result

any I dea what am I doing wrong?

1

There are 1 answers

0
Jester On BEST ANSWER

got it working, in case someone else comes along. my problem was the following

values.yml: set the generated apiToken on both sides gateway and hub

  hub:
    services:
      dask-gateway:
        apiToken: "abcd ..."

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
      jupyterhub:
        apiToken: "abcd ..."

Creating a connection now you go to the jupiter hub to create your apikey for the remote connection then the api is accessible via (traefik-test-dask-gateway) this root:

http://aa.bbb.ccc.ddd/services/dask-gateway

so you can call things like:

http://aa.bbb.ccc.ddd/services/dask-gateway/api/version