Skip to content

Commit

Permalink
prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivukotic committed Dec 11, 2023
1 parent c2629da commit 24398e9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 26 deletions.
7 changes: 3 additions & 4 deletions dask_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ labextension:

distributed:
dashboard:
# link: "https://{host}.dask.af.uchicago.edu/:{port}/status"
link: "https://dask.af.uchicago.edu:{port}/{host}/status"
link: "https://n4dask.af.uchicago.edu/{host}/status"
# link: "{scheme}://{host}:{port}/status"
scheduler:
work-stealing: false
Expand Down Expand Up @@ -74,10 +73,10 @@ kubernetes:
- scheduler
- --port
- "8786"
# - -bokeh-prefix
# - daskboard
- --bokeh-port
- "8787"
- --bokeh-prefix
- "{host}"
resources:
limits:
cpu: "1.75"
Expand Down
57 changes: 45 additions & 12 deletions kube/nginx_proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,29 @@ data:
worker_connections 10240;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8080;
server_name localhost;
location ^~ /daskboard/ {
proxy_pass http://dask-ivukotic-fb1cf4c5-5:8787;
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_http_version 1.1;
# proxy_redirect off;
# proxy_buffering off;
# proxy_set_header Upgrade $http_upgrade;
# # proxy_set_header Connection $connection_upgrade;
# proxy_read_timeout 86400;
location ^~ / {
if ( $request_uri ~ ^/(.*)/.*$ ) {
proxy_pass http://$1:8787;
}
# proxy_pass http://dask-ivukotic-fb1cf4c5-5:8787;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400;
}
}
}
Expand Down Expand Up @@ -78,3 +86,28 @@ spec:
nodePort: 30001
selector:
app: nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: n4dask
namespace: af-jupyter
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/ingress.class: nginx
spec:
tls:
- hosts:
- "n4dask.af.uchicago.edu"
secretName: nginx-tls
rules:
- host: n4dask.af.uchicago.edu
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: n4dask
port:
number: 80
10 changes: 0 additions & 10 deletions private_jupyter_notebook_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,3 @@
# Set shell to bash as AnalysisBase assumes it
# force login shell to pickup ~/.bash_profile
c.NotebookApp.terminado_settings = {"shell_command": ["/bin/bash", "-l"]}


def host_allowlist(handler, host):
handler.log.info("Request to proxy to host " + host)
return True
# return host.startswith("192.170") or host.startswith("2605:9a00:10:200a") or host.startswith("dask-")


# for dask dashboards to be visible
c.ServerProxy.host_allowlist = host_allowlist

0 comments on commit 24398e9

Please sign in to comment.