Description:
We need a way to define custom configurations in the Helm values.yaml (or a custom config.yaml) that can be accessed by both JupyterHub and JupyterLab instances running in the same Kubernetes cluster. This is critical for maintaining consistent settings (e.g., feature flags, API endpoints, or environment-specific variables) across all user sessions.
what sort of “custom configurations” are these, and how are they made available? If they are loaded as environment variables, perhaps the simplest way is to set them as environment variables in the Hub container and then pass them to singleuser containers via Spawner.env_keep.
More generally, you can create a configmap with your config (outside the jupyterhub chart) and then mount this as environment variables / volumes in both singleuser and hub.
Thank you for your quick and clear response! My use case is a bit special: I’ve heavily customized JupyterHub and JupyterLab (including extensions like context-menu), and now I need to reference the same external API URL in multiple places:
Python files (e.g., notebook utilities or backend logic).
**index.tsx** (frontend React components in JupyterLab extensions).
JupyterHub shared templates (e.g., HTML/JS under /usr/local/share/jupyterhub/templates/).
Currently, I’m hardcoding the URL everywhere, which is error-prone and hard to maintain. Is there a simple, centralized way to define this URL once and access it across all these contexts?
Ideal Solution Requirements:
Single source of truth (e.g., Helm values.yaml, ConfigMap, or environment variable).
Accessible in all three contexts:
Python (os.environ or config file).
TypeScript/React (e.g., injected at build time or fetched dynamically).
JupyterHub templates (e.g., via template variables).
(Bonus if it works with both Helm deployments and local development!)