Deploying Standalone JupyterLab on Kubernetes for Early Stage Startups
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:
- Since the volume is shared between users, it works as a self-discovery portal for all analysis between users/teams
- It can be a starting point for onboarding new team members who can see all your notebooks and ramp up quickly
- Share notebook links with each other easily for quick reviews and peer programming / debugging
- It’s very easy to setup and does not take a lot of resources
- Over all this, deploying in Kubernetes which can give you scalability and efficient resource utilization is cherry on top.
- Deploying it as a standalone project has immense benefit for an early stage startup or a small team where documentation is scarce.
- 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
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.
- 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
.
Conclusion
- Deploying JupyterLab is very easy and straightforward.
- It’s easy to configure and has battle tested pre-built image available