SSH into Kubespawner pod?

120 views
Skip to first unread message

David Rosenstrauch

unread,
Dec 18, 2020, 5:25:15 PM12/18/20
to Project Jupyter
I've recently set up Jupyter with kubespawner for our team, and it's working out nicely.  However, one of the next requests from the team is to allow them to ssh into their Jupyter pod, and I'm a little stumped on how to make that happen.

Setting up the ssh server listening in the pod seems do-able enough.  However, the challenge is the networking around getting them to connect to the ssh server running in their pod (and not anyone else's pod).

My thinking is that I might be able to set up a reverse proxy that forwards the SSH traffic to the user's pod.  But that requires matching the user's ID to the IP address of their running pod, which I can't see a way to do.

I've tried setting up a headless service that selects each of the running Jupyter pods - and therefore sets up a dns name for them.  But the dns name that gets created is specific to the IP (<ip_address>.<headless_service>.<namespace>.svc.cluster.local) rather than the pod's name (jupyter-<user_id>), and so again there's no easy way to tie that IP back to the user's ID.

Presumably Jupyter is storing that mapping of username to pod IP somewhere internally, but I don't see where.

Any suggestions on how it might be possible to accomplish this?

Thanks,

DR

Chris Holdgraf

unread,
Dec 18, 2020, 5:32:29 PM12/18/20
to jup...@googlegroups.com
This new-ish tool might be of use / interest? https://github.com/yuvipanda/jupyterhub-ssh

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/903de465-6f99-4868-ac1b-dd4c587460e3n%40googlegroups.com.

David Rosenstrauch

unread,
Dec 18, 2020, 5:59:05 PM12/18/20
to jup...@googlegroups.com


On 12/18/20 5:32 PM, Chris Holdgraf wrote:
> This new-ish tool might be of use / interest?
> https://github.com/yuvipanda/jupyterhub-ssh
> <https://github.com/yuvipanda/jupyterhub-ssh>

Wow, that looks pretty promising. Will definitely take a closer look at
it next week. Thanks much for posting!

DR
Reply all
Reply to author
Forward
0 new messages