diff --git a/README.md b/README.md index 185ddfb..55def79 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,31 @@ make down See `values.yaml` for all configuration options. The chart wraps the [JupyterHub Helm chart](https://z2jh.jupyter.org/) - all `jupyterhub.*` values are passed through. +### Nebi Registries + +Admins can provision OCI registries for every user's nebi instance via +`nebi.registries`. Only public (unauthenticated) registries are supported; +entries carry no credentials: + +```yaml +nebi: + registries: + - name: acme-registry + url: registry.acme.com + namespace: acme-envs + default: true +``` + +Each entry follows nebi's own `registries.entries` schema (`name`, `url`, +`namespace`, `default`) and is rendered into a ConfigMap mounted into user +pods, so entries are locked in the UI rather than editable per-user. + +Set `nebi.seedDefaultRegistry: false` to remove the built-in +`quay.io/nebari_environments` registry that nebi seeds by default. + +Both settings only take effect for user servers started after the hub pod +restarts, since the mount wiring lives in the hub ConfigMap. + ## Shared Storage Per-group shared directories (`/shared/` in every user pod) need a diff --git a/config/jupyterhub/01-spawner.py b/config/jupyterhub/01-spawner.py index 6a1e5bf..79ee718 100644 --- a/config/jupyterhub/01-spawner.py +++ b/config/jupyterhub/01-spawner.py @@ -70,6 +70,29 @@ }, ] +# --------------------------------------------------------------------------- +# Admin-provisioned nebi config (OCI registries, default-registry seed flag). +# Helm renders the deployer's `nebi.registries` / `nebi.seedDefaultRegistry` +# values into a ConfigMap and substitutes its name below; the placeholder +# stays literal (and is skipped) when the deployer customizes neither value. +# nebi searches /etc/nebi/config.yaml at boot, so mounting is all it takes. +# --------------------------------------------------------------------------- +_NEBI_CONFIG_CM = "__NEBI_CONFIG_CM__" +if _NEBI_CONFIG_CM and not _NEBI_CONFIG_CM.startswith("__"): + c.KubeSpawner.volumes.append( + { + "name": "nebi-config", + "configMap": {"name": _NEBI_CONFIG_CM}, + } + ) + c.KubeSpawner.volume_mounts.append( + { + "name": "nebi-config", + "mountPath": "/etc/nebi/config.yaml", + "subPath": "config.yaml", + } + ) + c.KubeSpawner.notebook_dir = "/home/jovyan" c.KubeSpawner.working_dir = "/home/jovyan" @@ -259,6 +282,16 @@ def _setup_trust_bundle(spawner): env["NEBI_STORAGE_WORKSPACES_DIR"] = "/var/lib/nebi/workspaces" +# nebi's local-mode netguard only accepts loopback Origin headers by default. +# Browsers send the hub's public origin on CORS-mode asset requests (the SPA +# bundle is emitted as