jupyterhub-outpost-secrets
by jupyterjsc
ExternalSecrets for a JupyterHub outpost
About this chart
JupyterHub outpost secrets
This chart generates three ExternalSecrets from one Vaultwarden item per
outpost. Leave secretStore.id unset to generate nothing. Configure the
SecretStore and the hub lists, for example:
secretStore:
name: bitwarden-fields
kind: ClusterSecretStore
id: vaultwarden-outpost-item-id
users:
- jupyterjsc
- juniq
cleanup:
- jupyterjsc
- juniq
flavors:
- jupyterjsc
- juniq
genericFields:
- SQL_DATABASE
- SQL_HOST
- SQL_PORT
- SQL_TYPE
# Kube outposts may also need:
# - REPO2DOCKER_IMAGE_PREFIX
# - REPO2DOCKER_PROJECT_URL
# - REPO2DOCKER_REPOSITORY_TAGS_URL
# - REPO2DOCKER_TOKEN
# - STORAGE_MANAGER_TOKEN
# - STORAGE_MANAGER_URL
The generated Secrets are es-outpost-cryptkey, es-outpost-users, and
es-outpost-generics, in the release namespace. They do not replace or rewire
the existing outpost-* Secrets. Point consumers to them only after comparing
the data. The SecretStore must be accessible from the release namespace.
Vaultwarden fields
All values are plain text; Kubernetes handles Secret data encoding.
| Field | Use |
|---|---|
secret_key | Copied into es-outpost-cryptkey as secret_key. |
username_<slug>, password_<slug> | For each entry in users, copied into the semicolon-separated usernames and passwords lists in that order. These fields are the same ones used by the hub chart. |
password_<slug>, cleanup_url_<slug> | For each entry in cleanup, generate aligned semicolon-separated JUPYTERHUB_CLEANUP_NAMES, JUPYTERHUB_CLEANUP_TOKENS, and JUPYTERHUB_CLEANUP_URLS. Passwords are copied unchanged as cleanup tokens. |
flavor_token_<slug> | For each entry in flavors, copied unchanged into FLAVOR_<UPPERCASE_SLUG>_AUTH_TOKEN. |
Lowercase of each genericFields entry | Copied unchanged into the corresponding uppercase key in es-outpost-generics. |
Use the actual Vaultwarden item ID as secretStore.id, including in the
jupyterhub-secrets chart's secretStores.ids.outposts. That chart additionally uses outpost
fields such as authKey_<slug>, initsystem_<slug>, name_<slug>, and
url_<slug>; cleanup_url_<slug> is a separate hub cleanup endpoint.
Add a slug to each applicable list and add its fields to Vaultwarden to onboard
a hub; list order is preserved and each list can differ. users must be
nonempty when the item ID is set. Empty cleanup produces three empty cleanup
values. When no cleanup, flavor, or generic fields are configured, ESO still
reads secret_key to ensure it reconciles the generic Secret; that field is
not included in its output. Slugs must contain lowercase letters and digits; duplicates within a
list are rejected. User credentials and cleanup values must be nonempty and
cannot contain semicolons. Flavor and additional generic values must be nonempty.
genericFields must contain unique environment variable names and cannot use
the reserved FLAVOR_ or JUPYTERHUB_CLEANUP_ prefixes.
The templates require an ESO v2 template engine with Sprig's fail function,
as supported by ESO v2.0.1. A selected missing field fails reconciliation;
no automatic field fallback is performed.
Deploy jupyterhub-outpost-secrets with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has jupyterhub-outpost-secrets on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartjupyterhub-outpost-secrets is pinned at v0.1.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply