Skip to content

Commit

Permalink
Add jupyterhub-ssh (including deployment workarounds)
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Jul 18, 2021
1 parent cc8a545 commit bba00ce
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 7 deletions.
65 changes: 63 additions & 2 deletions config/hubs/jmte.cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,60 @@ hubs:
# Along with this, we also make use of the autohttps system that
# requires us to configure an letsencrypt email.
#
service:
type: LoadBalancer
https:
enabled: true
type: letsencrypt
letsencrypt:
contactEmail: erik@sundellopensource.se

# jupyterhub-ssh notes:
#
# - We must accept port 22 traffic to the k8s Service receiving
# hub.jupytearth.org traffic.
# - We must accept traffic on the autohttps pod (traefik) as well as
# traffic will flow onwards from there. A port must be open, and
# the NetworkPolicy influencing trafik must tolerate incoming
# (ingress) traffic to the ssh port.
# - We must let traefik route the traffic to the jupyterhub-ssh
# service. An entrypoint must be declared, a service backend, and
# a router.
#
service:
type: LoadBalancer
extraPorts:
- name: ssh
port: 22
targetPort: ssh
traefik:
extraPorts:
- name: ssh
containerPort: 8022
networkPolicy:
allowedIngressPorts: [http, https, ssh]
extraStaticConfig:
entryPoints:
ssh:
address: :8022
extraDynamicConfig:
tcp:
services:
ssh:
loadBalancer:
servers:
- address: jupyterhub-ssh:22
routers:
ssh-router:
entrypoints:
- ssh
rule: HostSNI(`*`)
service: ssh



hub:
image:
name: quay.io/consideratio/k8s-hub
tag: 1.0.1-n045.h10b2c8d3
config:
Authenticator:
allowed_users: &users
Expand Down Expand Up @@ -219,3 +264,19 @@ hubs:
# per Dask cluster limits.
c.ClusterConfig.cluster_max_cores = 256
c.ClusterConfig.cluster_max_memory = "1028G"
jupyterhub-ssh:
hubUrl: https://hub.jupytearth.org

# FIXME: hostKey is set via a dirty hack in hub.py of the deployer CLI
# using an environment variable defined in a .gitignored .env
# file on my local computer.
#
# Related: https://github.com/yuvipanda/jupyterhub-ssh/issues/38

ssh:
enabled: true

sftp:
enabled: false
1 change: 1 addition & 0 deletions deployer/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ def deploy(self, auth_provider, secret_key, skip_hub_health_test=False):
# we should put the config from config/hubs last.
'-f', generated_values_file.name,
'-f', values_file.name,
f'--set-string=jupyterhub-ssh.hostKey={os.environ["JUPYTERHUB_SSH_KEY_PRIV"]}',
]

print(f"Running {' '.join(cmd)}")
Expand Down
13 changes: 8 additions & 5 deletions hub-templates/daskhub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ description: Deployment Chart for a dask-enabled JupyterHub
name: daskhub
version: "0.1.0"
dependencies:
- name: basehub
repository: file://../basehub
- name: dask-gateway
version: "0.9.0"
repository: 'https://dask.org/dask-gateway-helm-repo/'
- name: basehub
repository: file://../basehub
- name: dask-gateway
version: "0.9.0"
repository: 'https://dask.org/dask-gateway-helm-repo/'
- name: jupyterhub-ssh
version: 0.0.1-n077.h0c9caba
repository: https://yuvipanda.github.io/jupyterhub-ssh/

0 comments on commit bba00ce

Please sign in to comment.