Product UI and dashboard hosts
By default a production’s UIs (Studio, a product’s own screens) are served under
/bundles/<production>/<replica>/<job>/ on the Manager’s own origin. Every one
of them then shares that origin with the Manager’s UI and API, so a script in
one could act as the signed-in operator. norsk-mgr raises a standing alert
while that is the case.
Setting productUiDomain moves them onto subdomains of their own, and is also
what fleet dashboards are served from.
Set it up
Section titled “Set it up”-
DNS: a wildcard record,
*.apps.example.com, pointing at the manager host (the same address as the Manager’s own name). -
Certificate: a wildcard certificate and key for
*.apps.example.com, readable by norsk-mgr. Wildcards need a DNS challenge, so an HTTP-01 certbot setup cannot issue one; use your DNS provider’s ACME plugin or your own CA. -
~/.norsk-mgr/config.yaml:externalUrl: https://mgr.example.comproductUiDomain: apps.example.comproductUiCertPath: /etc/norsk-mgr/apps.example.com/fullchain.pemproductUiKeyPath: /etc/norsk-mgr/apps.example.com/privkey.pemnorsk-mgr refuses to start with
productUiDomainand no certificate, unless the install issecurityMode: insecure.externalUrlis where a subdomain sends a browser to sign in; without it those hosts cannot sign anyone in. -
Restart norsk-mgr. The certificate is copied into the proxy on every reload, so a renewed one is picked up by the next.
The hosts product UIs get
Section titled “The hosts product UIs get”| Production | Host |
|---|---|
| launched from a production template | t-<template>.apps.example.com |
| launched without one | p-<production>.apps.example.com |
Each runtime is at /<production>/<replica>/<job>/ on its host, wherever it runs:
a runtime that moves to another worker keeps its address. The host root
answers 404, since no single runtime owns it. The old /bundles/... links
redirect to the new address.
The origin is the trust boundary, and it is the production template. Every production launched from one template shares that template’s origin, so its UIs can reach each other with the signed-in user’s session. Desks whose people hold different roles should launch from different templates.
Signing in on a subdomain
Section titled “Signing in on a subdomain”norsk-mgr holds a session of its own on each subdomain it serves. A browser arriving with none is sent through norsk-mgr’s sign-in and back, and is given a session for that host only. Every request then reaches the worker with norsk-mgr vouching for the user, so no worker holds a session on these hosts. Signing out of norsk-mgr ends the sessions on every subdomain: a dashboard’s directory refuses at once, and every host stops serving within a minute (nginx keeps a session check for 60 s).
Fleet dashboards
Section titled “Fleet dashboards”A fleet dashboard is a static bundle norsk-mgr hosts, which reads the
directory: the runtimes the signed-in user may see, and what discovery holds
about each. Its author builds it with ctl-dev-kit create-dashboard; registering
it takes mgr:dashboard.manage (the builder role). Where it is served is chosen
when it is registered:
| Hosting | Host | Registered with |
|---|---|---|
| its own | <name>.apps.example.com | norsk-mgr dashboard register <name> |
| shared with a group | <group>.apps.example.com/<name>/ | --hosting shared:<group> |
| a host per production, template or label value | e.g. event-<id>.apps.example.com | --hosting pattern:event-{id} --scope production |
Then upload its bundle, built as dashboard.tar:
norsk-mgr dashboard upload <name> dashboard.tarUploading again replaces it in place, on the same host. Dashboards sharing a group share an origin, and so each other’s reach: that is the registering operator’s call. Each host a pattern yields is an origin of its own, and answers only for the production, template or label value its id names.
What a dashboard host serves:
- the bundle, to anyone signed in to norsk-mgr. Opening a dashboard needs no role, because what it shows is decided per user.
- the directory at
/_fleet/directory, and live at/_fleet/directory/watch. It lists the runtimes the signed-in user may see, no wider than the kinds the dashboard’sdashboard.jsonsays it uses, and on a pattern host within its scope.
Names are one DNS label and may not start with t- or p-, which product UI
hosts use. A dashboard whose host another already has, other than through its
group, is refused. Bundles are capped at 32 MiB
(NORSK_MGR_MAX_DASHBOARD_BUNDLE_BYTES).
A dashboard can be registered before productUiDomain is set, but nothing
serves it until it is.