Deploying Standalone JupyterLab on Kubernetes for Early Stage Startups

Deepak Sood
Analytics Vidhya
Published in
3 min readApr 28, 2020

JupyterHub and JupyterLab has taken the Python and Data Science world by storm and it played a major role in making Python the top most loved programming language. It gives a frictionless gateway to people who want to get started with Data Science and Machine Learning with platform like Google Colab and Kaggle which provides free TPU with no infrastructure provisioning and maintenance.

Setting up a JupyterHub for a large team makes sense where each user will have there own isolated environment for both computation and files. But for a small team JupyterHub is an overkill.

Advantages of Standalone JupyterLab

Hosting a standalone JupyterLab helps in so many ways:

  1. Since the volume is shared between users, it works as a self-discovery portal for all analysis between users/teams
  2. It can be a starting point for onboarding new team members who can see all your notebooks and ramp up quickly
  3. Share notebook links with each other easily for quick reviews and peer programming / debugging
  4. It’s very easy to setup and does not take a lot of resources
  5. Over all this, deploying in Kubernetes which can give you scalability and efficient resource utilization is cherry on top.
  6. Deploying it as a standalone project has immense benefit for an early stage startup or a small team where documentation is scarce.
  7. Large computations can be run easily without depending on your system configurations

Docker-stacks

Using docker-stacks prebuilt Data Science images frees you from writing your own Dockerfile and building your own image. It has different variants of images and is battle tested. So we will use docker-stacks jupyter/datascience-notebook image for deploying our JupyterLab Deployment

docker-stacks image hierarchy

It just takes 30 mins at max to deploy standalone Jupyter notebook in Kubernetes using docker-stacks pre-built images.

So let’s get started.

  1. Create jlab namespace kubectl create namespace jlab .

2. Get external-ip of your deployed service kubectl get svc -n jlab

3. Navigate to the external-ip in your browser to access JupyterLab.

Use password passed in command--LabApp.token=password , here it’s password . If not passed see in logs of container for token .

JupyterLab UI and Launcher

Conclusion

  1. Deploying JupyterLab is very easy and straightforward.
  2. It’s easy to configure and has battle tested pre-built image available

--

--

Deepak Sood
Analytics Vidhya

MTech in Computer Science | Senior Data Engineer @ AIML Data Analytics | Life Long Learner | https://deepaksood619.github.io