JupyterHub 플랫폼 정리
기본 정보
섹션 제목: “기본 정보”| 항목 | 값 |
|---|---|
| version | JupyterHub Helm chart v4.4.0, Hub image v4.4.0 |
| 공식 문서 | Zero to JupyterHub |
| chart 소스 | base/jupyterhub/charts/jupyterhub-4.4.0 |
| dev overlay | overlays/dev/jupyterhub |
개념과 특징
섹션 제목: “개념과 특징”JupyterHub는 Kubeflow Notebooks control plane의 일부가 아니다. Kubeflow Notebooks는 Profile namespace에 Notebook custom resource와 StatefulSet을 만들고 Dashboard와 Istio gateway에 통합한다. 반면 JupyterHub는 자체 namespace에서 Hub, Configurable HTTP Proxy, KubeSpawner를 실행하고 로그인한 계정별 single-user Pod를 같은 namespace에 직접 생성한다.
현재 overlay는 development 환경용 DummyAuthenticator를 사용한다. 지정된 shared password로 로그인한 admin account만 administrator 권한을 갖고, Dex, oauth2-proxy, Kubeflow Profile, Kubeflow Dashboard SSO와는 연결하지 않는다. 따라서 이 배포를 tenant identity 또는 production authentication 경계로 사용하면 안 된다.
Architecture 구성
섹션 제목: “Architecture 구성”| 구성 | 역할 |
|---|---|
| Hub | 로그인 session, user와 server state, spawn lifecycle을 관리하고 KubeSpawner를 실행한다. |
| Configurable HTTP Proxy | public request를 Hub 또는 해당 user’s single-user server로 routing한다. |
| KubeSpawner | Hub의 namespace-local RBAC로 single-user Pod, Service, PVC를 생성하고 삭제한다. |
| single-user server | profile에서 선택한 Jupyter Docker Stack image를 jupyterhub-singleuser command로 실행한다. |
| idle culler | 1시간 동안 idle 상태인 user server와 user session을 정리한다. |
제공 profile과 workspace
섹션 제목: “제공 profile과 workspace”사용자는 spawn 시 다음 Jupyter Docker Stack profile 중 하나를 선택한다. 모든 profile은 2026-07-20 image tag를 사용하며, image pre-puller가 비활성이라 첫 server spawn에서 해당 node가 image pull을 수행한다.
| profile | image |
|---|---|
| Base Notebook | quay.io/jupyter/base-notebook:2026-07-20 |
| Minimal Notebook | quay.io/jupyter/minimal-notebook:2026-07-20 |
| Data Science Notebook | quay.io/jupyter/datascience-notebook:2026-07-20 |
| SciPy Notebook | quay.io/jupyter/scipy-notebook:2026-07-20 |
| TensorFlow Notebook | quay.io/jupyter/tensorflow-notebook:2026-07-20 |
| PyTorch Notebook | quay.io/jupyter/pytorch-notebook:2026-07-20 |
| R Notebook | quay.io/jupyter/r-notebook:2026-07-20 |
| Julia Notebook | quay.io/jupyter/julia-notebook:2026-07-20 |
KubeSpawner는 user server별 dynamic PVC를 만들고 /home/jovyan에 mount한다. PVC의 requested capacity는 10Gi이고 access mode는 ReadWriteOnce다. PVC는 Pod보다 오래 유지되므로 idle culler가 server Pod를 삭제해도 workspace data는 남는다. storage class를 명시하지 않으므로 cluster default StorageClass가 dynamic provisioning을 지원해야 한다.
Kubeflow에서의 역할
섹션 제목: “Kubeflow에서의 역할”Kubeflow Notebooks는 Profile과 Dashboard workflow가 필요한 tenant-oriented Notebook platform이다. JupyterHub는 이 control plane을 거치지 않고, shared account 기반의 간단한 Jupyter Docker Stack environment를 별도 hostname으로 제공한다. 따라서 platform administrator가 기본 Python, R, Julia, TensorFlow, PyTorch 환경을 빠르게 제공하는 목적에는 적합하지만, Profile namespace isolation이나 Kubeflow Dashboard access control을 대체하지 않는다.
핵심 기여
섹션 제목: “핵심 기여”- profile-based server selection: image별 별도 deployment를 만들지 않고 user spawn 과정에서 eight standard environment를 선택한다.
- persistent development workspace: user server replacement와 idle culling 이후에도
/home/jovyanworkspace PVC를 유지한다. - shared metadata store: Hub의 user, group, OAuth token, server, spawn state를 shared Percona MySQL
jupyterhublogical database에 보존한다. - independent browser route: Azure web app routing Ingress가
proxy-publicService로 traffic을 전달한다. - namespace-local runtime: Hub RBAC와 NetworkPolicy가
jupyterhubnamespace 안에서 Hub, proxy, single-user workload 관계를 제한한다.
배포 구조
섹션 제목: “배포 구조”overlay 구성
섹션 제목: “overlay 구성”overlays/dev/jupyterhub -> base/jupyterhub/charts/jupyterhub-4.4.0 -> values.yaml -> Hub MySQL URI and DummyAuthenticator Secret references -> KubeSpawner profile list and dynamic workspace PVC -> NetworkPolicy, idle culler, scheduling settings -> ingress.yaml -> cert-manager Certificate -> Azure web app routing Ingresskustomization.yaml은 Helm chart와 ingress.yaml만 resource로 render한다. local jupyterhub-mysql.secret.yaml과 jupyterhub.secret.yaml template는 주석 처리되어 있으므로 active deployment에 포함되지 않는다. 아래 Secret은 secret controller 또는 별도 provisioning으로 Hub Deployment 전에 존재해야 한다.
| Secret | required key | 용도 |
|---|---|---|
jupyterhub-db-secret | uri | mysql+pymysql 형식의 Hub database URI |
jupyterhub-secret | admin-password | DummyAuthenticator의 shared password |
Hub chart는 proxy authorization token, cookie secret, encryption key를 담는 별도 Secret/hub를 render하지만 external Secret 두 개는 만들지 않는다.
주요 runtime 설정
섹션 제목: “주요 runtime 설정”| 항목 | 현재 값 | 의미 |
|---|---|---|
| Hub / proxy replica | 각각 1 | high availability가 아닌 single replica deployment |
| Hub image | quay.io/jupyterhub/k8s-hub:4.4.0 | JupyterHub와 KubeSpawner runtime |
| proxy image | quay.io/jupyterhub/configurable-http-proxy:5.2.0 | Hub route proxy |
| authentication | DummyAuthenticator | shared password 기반 development authentication |
| Hub database | MySQL jupyterhub logical database | Hub state의 durable backend store |
| named server | 비활성 | user별 named server를 만들지 않음 |
| shared PVC | dynamic 10Gi, ReadWriteOnce | single-user workspace를 /home/jovyan에 mount |
| service account token | single-user Pod에서 비활성 | automountServiceAccountToken: false |
| idle culling | 활성 | 3600초 idle, 600초 간격, administrator 포함 |
| user scheduler / placeholder / pre-puller | 비활성 | default scheduler를 사용하고 image를 미리 pull하지 않음 |
ingress와 network policy
섹션 제목: “ingress와 network policy”Certificate/jupyterhub-ingressgateway-certs는 kubeflow-self-signing-issuer ClusterIssuer로 hostname TLS Secret을 발급한다. Ingress/jupyterhub-ingress는 Azure web app routing ingress class를 사용해 jupyterhub.<cluster-domain>/ request를 proxy-public:80으로 전달한다. body size limit은 없고, read와 send timeout은 각각 3600초다.
chart는 hub, proxy, singleuser NetworkPolicy를 생성한다. Hub는 proxy API와 single-user server port에 연결하고, proxy는 Hub와 single-user server를 연결한다. single-user egress는 Hub, proxy, DNS 및 non-private address에 허용된다. Private address access와 cross-namespace access는 NetworkPolicy와 CNI implementation의 실제 enforcement를 함께 확인해야 한다.
Deployment view
섹션 제목: “Deployment view”Resource Placement
섹션 제목: “Resource Placement”| namespace | resource | 이름 | 역할 |
|---|---|---|---|
jupyterhub | Deployment | hub | authentication, database state, KubeSpawner lifecycle 관리 |
jupyterhub | Deployment | proxy | Configurable HTTP Proxy 실행 |
jupyterhub | Service | hub, proxy-api, proxy-public | Hub API, proxy API, external request target |
jupyterhub | ServiceAccount + Role + RoleBinding | hub | Pod, PVC, Service, Secret lifecycle에 대한 namespace-local Hub 권한 |
jupyterhub | ConfigMap + Secret | hub | rendered JupyterHub configuration과 chart-managed key material |
jupyterhub | NetworkPolicy | hub, proxy, singleuser | component 내부 traffic 제어 |
jupyterhub | Certificate | jupyterhub-ingressgateway-certs | browser hostname TLS Secret 발급 |
jupyterhub | Ingress | jupyterhub-ingress | root path를 proxy-public:80으로 routing |
jupyterhub | Secret | jupyterhub-secret | external provision required, DummyAuthenticator password |
jupyterhub | Secret | jupyterhub-db-secret | external provision required, MySQL URI |
mysql | Percona MySQL Service | ps-db-haproxy | jupyterhub database writer endpoint |
jupyterhub | Pod + PVC | KubeSpawner generated | user별 selected environment와 persistent workspace |
Diagram
섹션 제목: “Diagram”PlantUML 원본:
동작 흐름
섹션 제목: “동작 흐름”Login, spawn, and access
섹션 제목: “Login, spawn, and access”- browser가 independent JupyterHub hostname으로 request를 보낸다.
- Azure web app routing Ingress가
proxy-publicService와 Configurable HTTP Proxy로 request를 전달한다. - Proxy는
/hub/request를 Hub에 전달하고 DummyAuthenticator가 externally provisionedadmin-password와 user input을 비교한다. - authenticated user가 profile을 선택하면 Hub의 KubeSpawner가 single-user Pod, Service, dynamic 10Gi RWO PVC를 만든다.
- selected image의
jupyterhub-singleuserprocess가 시작되고/home/jovyan에 workspace PVC를 mount한다. - Hub가 proxy route를 등록한 뒤 Proxy가
/user/<name>/request를 해당 single-user server로 전달한다. - idle culler는 600초 간격으로 activity를 확인하고 3600초 이상 idle인 user server와 user session을 정리한다. PVC는 이 과정에서 삭제되지 않는다.
PlantUML 원본:
의존성과 상호작용
섹션 제목: “의존성과 상호작용”선행 / 후행
섹션 제목: “선행 / 후행”- 선행 (이게 먼저 Ready 여야 함):
jupyterhubnamespace, cluster default StorageClass, Percona MySQL writer Service와jupyterhubdatabase, two external Secrets, cert-manager ClusterIssuer, Azure web app routing ingress controller, and profile image availability. - 후행 (나를 의존): JupyterHub user와 single-user server는 Hub가 Ready 된 뒤 생성된다. user server에서 Kubeflow API, MLflow, object storage를 사용할 수 있지만 현재 overlay는 해당 credential 또는 endpoint를 자동 주입하지 않는다.
runtime 상호작용
섹션 제목: “runtime 상호작용”Hub는 jupyterhub-db-secret.uri를 DB_URI environment variable로 읽고 c.JupyterHub.db_url로 적용한다. URI는 mysql+pymysql://<user>:<url-encoded-password>@<mysql-writer>.<db-namespace>.svc.cluster.local:3306/jupyterhub 형식이어야 한다. Hub만 MySQL에 연결하며 proxy와 single-user Pod는 이 database를 사용하지 않는다. z2jh가 공식적으로 권장하는 backend는 PostgreSQL인데 이 배포가 공용 MySQL을 쓴 이유와 그에 따르는 charset, index key length, driver, migration 위험은 JupyterHub를 공용 MySQL 위에 올린 이유에서 따로 다룬다. database bootstrap과 minimal privilege contract는 공용 데이터 서비스(MySQL·Object Storage)를 따른다.
Hub ServiceAccount는 namespace의 Pod, PVC, Secret, Service lifecycle을 관리할 권한을 가진다. single-user Pod는 ServiceAccount token automount가 꺼져 있으므로 Kubernetes API access를 기본으로 갖지 않는다. user workload에 Kubernetes API 권한이 필요하면 current security model을 검토한 뒤 명시적 ServiceAccount와 최소 RBAC를 별도로 설계해야 한다.
이 ingress는 Kubeflow kubeflow-gateway, oauth2-proxy external authorization, Dex redirect path를 사용하지 않는다. hostname traffic은 JupyterHub Proxy와 DummyAuthenticator에서 끝나므로 Kubeflow Profile identity, Dashboard role, Notebook CR ownership과 자동으로 연결되지 않는다.
핵심 리소스
섹션 제목: “핵심 리소스”Deployment/hub: Hub database state, DummyAuthenticator, KubeSpawner, idle culler service configuration을 실행한다.Deployment/proxy와Service/proxy-public: browser request와 user server route를 중계한다.Role/hub와RoleBinding/hub: Hub가 namespace-local user runtime resource를 생성하고 관찰할 수 있게 한다.NetworkPolicy/hub,proxy,singleuser: component 내부 ingress와 egress relationship을 선언한다.Secret/jupyterhub-secret: deployment 전에 별도로 provision해야 하는admin-passwordsource다.Secret/jupyterhub-db-secret: deployment 전에 별도로 provision해야 하는 MySQLurisource다.Certificate/jupyterhub-ingressgateway-certs와Ingress/jupyterhub-ingress: independent hostname TLS와proxy-publicrouting을 제공한다.
- overlay:
overlays/dev/jupyterhub - chart:
base/jupyterhub/charts/jupyterhub-4.4.0 - related infrastructure: 공용 데이터 서비스(MySQL·Object Storage), Kubeflow Notebooks
| 추가 runtime 점검 | 의존성과 boundary section을 확인한다 |
|---|---|
| 적용 범위 | standalone JupyterHub deployment에 한정한다 |
browser -> proxy-public -> Hub -> KubeSpawner -> single-user server