Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately, I couldn't make this work in a production environment (Kubernetes Cluster, one traefik deployment, one etcd deployment, one jupyterhub with internal ssl). While at first glance everything looks fine, we're hitting two types of SSL Errors, which we don't see with a nginx, chp + jupyterhub setup.
At the moment, I don't fully understand the reason for that. I assume traefik reuses connections that tornado has already closed.
Details on Traefik setup:
(click to open)
Proxy Class used in this setup (click to open)
JupyterHub config: (click to open)
ServersTransport: (click to open)
IngressRoute (click to open)
Errors:
(click to expand)
On JupyterHub:On JupyterLab, e.g. when opening a XPra Proxy
Previous message (click to open)
PR for #191I have not added tests so far. In the tests
TraefikProxyis created without a MockHub includingapp.internal_ssl.This PR adds support for 3 cases:
TraefikProxy.should_start=True)TraefikProxy.enable_setup_dynamic_config=True)TraefikProxy.enable_setup_dynamic_config=False) (internal-ssl certificates have to already exist)All tested with redis as provider (already running locally)
1. Start Proxy
jupyterhub_config.py
Run JupyterHub, Hub available at http://localhost:8000
2. Running Proxy, with dynamic config
Start traefik:
traefik --entryPoints.traefik.address=:8080/tcp --entryPoints.http.address=:8000/tcp --ping=true --log.level=INFO --api.insecure=true --providers.redis --providers.redis.endpoints=localhost:6379 --providers.redis.password=<password> --providers.redis.rootkey=traefikjupyterhub_config.py:
TraefikProxy._setup_traefik_dynamic_configsetshttp.serversTransportsto the absolutc.JupyterHub.internal_certs_location(code). Therefore traefik + JupyterHub must run on the same machine (or traefik must use the same pathes for the proxy-client certificates)3. Running Proxy, configure serversTransports externally
In this example I've used Traefik FileProvider.:
Setup yml File with serverTransports configuration:
/home/ubuntu/traefik_dynamic/transport.ymlStart traefik (notice file provider)
traefik --entryPoints.traefik.address=:8080/tcp --entryPoints.http.address=:8000/tcp --ping=true --log.level=INFO --api.insecure=true --providers.redis --providers.redis.endpoints=localhost:6379 --providers.redis.password=<password> --providers.redis.rootkey=traefik --providers.file --providers.file.directory=/path/to/traefikprovider/dynamic --providers.file.watch=truejupyterhub_config.py:c.TraefikRedisProxy.traefik_http_servers_transportand.enable_setup_dynamic_configare important)