Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Follow publication

Deploying Jupyterhub on Kubernetes

DaeGon Kim
Dev Genius
Published in
4 min readDec 11, 2024

--

Today we will deploy jupyterhub that provides jupyter notebooks for multiple users.

Jupyter Notebook is a web application for creating and managing computational documents and it enables a fast prototyping of application deployment. The following screenshot shows the data science notebook homepage.

Prerequite and Optional components

Here we need a Kubernetes cluster and helm utility. On the Kubernetes, we use a storage class, a load balancer and cert-manager.

  • Kubernetes cluster, steps for deploying with kubespray are here.
  • Helm, package manager for Kubernetes. A tutorial is available.
  • Storage Class, rook-ceph-rbd is used for this article. A step-by-step guide for setup is provided here. A storage class (Persistent Volume) is required, but any storage class like Longhorn should be fine.
  • Load Balancer, MetalLB is used. This is to expose the hub service through a load balancer ip. If other mechanisms, such as port forward, node port, ingress, are used, this component is not needed. How to deploy MetalLB is described here.
  • cert-manager, this is for https (tls) service. A deployment steps for self-signed certificate is described here.

Jupyterhub Installation

First, we create a namespace and a certificate for https service.

kubectl create namespace jupyterhub
kubectl apply -f yamls/proxy-certificate.yaml
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: proxy-certificate
namespace: jupyterhub
spec:
dnsNames:
- jupytherhub.example.com
# ipAddresses:
# - 172.25.40.10
secretName: proxy-tls-secret
issuerRef:
name: cluster-issuer-with-ca
kind: ClusterIssuer
subject:
organizations:
- Example INC
organizationalUnits:
- Example Team

Now we will get a jupyterhub helm chart.

helm repo add jupyterhub https://hub.jupyter.org/helm-chart/
helm repo update jupyterhub
helm search repo jupyterhub/jupyterhub # for the latest version
helm search repo jupyterhub/jupyterhub --versions # for all versions
helm fetch jupyterhub/jupyterhub --version 3.3.8 --untar #…

--

--

No responses yet

Write a response