JupyterHub Kubernetes template spawner
Project description
KubeTemplateSpawner
⚠️⚠️⚠️⚠️⚠️ Under development ⚠️⚠️⚠️⚠️⚠️
A JupyterHub Kubernetes spawner that uses Kubernetes templates.
How this works
This takes a set of parameterised Helm templates that deploy a JupyterHub singleuser server, then:
- creates a temporary Helm
values.yamlfile with JupyterHub template variables - runs
helm template ... - deploys the templated manifests
The following template variables are available
Raw user and server:
useridunescaped_usernameunescaped_servername
Escaped user and server (based on the KubeSpawner safe scheme):
escaped_usernameescaped_servernameescaped_user_server
Spawner variables:
instance: Instance name to distinguish multiple JupyterHub deploymentsnamespace: Kubernetes namespaceip: IP the server should listen onportPort the server should listen onenv: Dictionary ofkey: valueenvironment variables
Additional variables:
- Variables from
KubeTemplateSpawner.extra_varsare included, and can override the above
Labels
All resources must include an instance label to distinguish multiple deployments:
app.kubernetes.io/instance: {{ .Values.instance }}
User resources must include:
hub.jupyter.org/username: "{{ .Values.escaped_username }}"
User server resources (that aren't shared between default and named servers) must also include:
hub.jupyter.org/servername: "{{ .Values.escaped_servername }}"
Connection annotation:
kubetemplatespawner/connection=true: One resource per server (either a pod or service) must have this annotation to indicate JupyterHub should use this resource to connect to the server
Lifecycle/deletion
These control when resources are deleted.
kubetemplatespawner/lifecycle=user-deleted: Delete this resource when the user is deleted, typically used for storage volumeskubetemplatespawner/lifecycle=server-stopped: Delete this resource when the user server is stopped, typically the default for most resources other than persistent storagekubetemplatespawner/lifecycle=server-deleted: Delete this resource when a named server is deleted, use this if a named server has a separate storage volume that doesn't need to be kept
Resources are deleted by matching all labels:
app.kubernetes.io/instance: {{ .Values.instance }}hub.jupyter.org/username: "{{ .Values.escaped_username }}"hub.jupyter.org/servername: "{{ .Values.escaped_servername }}"(servers only)
Example
https://github.com/manics/jupyterhub-kubetemplatespawner/tree/main/z2jh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kubetemplatespawner-0.1.0.tar.gz.
File metadata
- Download URL: kubetemplatespawner-0.1.0.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ea7085d1d6743d40fdb1ab9de33314157bd383a2f9a1c17d0366d011fe6ee90
|
|
| MD5 |
7ddc4539167b03056ecf04c8376806fe
|
|
| BLAKE2b-256 |
e016661cc2e576ea1eee258d40ef26b9dd9a7c80a90e32cabb4daa44d7487a3e
|
Provenance
The following attestation bundles were made for kubetemplatespawner-0.1.0.tar.gz:
Publisher:
workflow.yml on manics/jupyterhub-kubetemplatespawner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kubetemplatespawner-0.1.0.tar.gz -
Subject digest:
9ea7085d1d6743d40fdb1ab9de33314157bd383a2f9a1c17d0366d011fe6ee90 - Sigstore transparency entry: 200356402
- Sigstore integration time:
-
Permalink:
manics/jupyterhub-kubetemplatespawner@22849de38c7e293c5356ffdf9fd4eee95c7e1a24 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/manics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@22849de38c7e293c5356ffdf9fd4eee95c7e1a24 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kubetemplatespawner-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kubetemplatespawner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
567c952fd30ca8f35124961df119f8d4b13ae5760003061180317e2e2cb0bbee
|
|
| MD5 |
968b22c92f005452057f77c4b3964f1c
|
|
| BLAKE2b-256 |
565d6479c342f61cda173c0c5231801152f17738365fc0b871d565bb6408ff0c
|
Provenance
The following attestation bundles were made for kubetemplatespawner-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on manics/jupyterhub-kubetemplatespawner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kubetemplatespawner-0.1.0-py3-none-any.whl -
Subject digest:
567c952fd30ca8f35124961df119f8d4b13ae5760003061180317e2e2cb0bbee - Sigstore transparency entry: 200356420
- Sigstore integration time:
-
Permalink:
manics/jupyterhub-kubetemplatespawner@22849de38c7e293c5356ffdf9fd4eee95c7e1a24 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/manics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@22849de38c7e293c5356ffdf9fd4eee95c7e1a24 -
Trigger Event:
push
-
Statement type: