M3-S1 — Web addresses for the tenant and its spaces
Section titled “M3-S1 — Web addresses for the tenant and its spaces”| Module | M3 — Addresses and the gateway |
| After this session you can | Make a new address work for a space or a partner domain, in the right order, and prove the plan for production before you change anything. |
| Time | Facilitated: 33 min · On your own: 33 min |
| Before you start | M2-S3: the nw release at its last good revision. From ACSA: spaces and domains. |
| Go deeper | Spaces & domains: technical reference · Helm chart: routing |
◆ Orientation (1 min) — “Please set up customs.northwind.example.com”
Section titled “◆ Orientation (1 min) — “Please set up customs.northwind.example.com””In the ACSA capstone, Northwind’s administrator planned a space for the new customs desk and sent you its address before announcing it. In ACSA you learned why: a space on a new address works only once the address is set up for the platform. Now you are the person who sets it up. This session shows what “set up” means, layer by layer, and in which order you and the administrator work.
▤ Concept (3 min) — Two layers between an address and the data
Section titled “▤ Concept (3 min) — Two layers between an address and the data”What the administrator owns, and what you own
Section titled “What the administrator owns, and what you own”From ACSA you know the administrator’s side: a space has an identifier, and its address is the
identifier followed by its domain’s address (customs + northwind.example.com); a domain
record lists the hosts it covers and the sign-in options on them. The platform publishes both lists
to Redis for the gateway. You own everything in front of those records: the name, the
certificate, the route into the cluster, and the sign-in callbacks.
Layer 1: the ingress
Section titled “Layer 1: the ingress”A request first meets the ingress controller, which only routes hosts it has been told about. The
chart creates an Ingress (or Gateway API routes, or OpenShift Routes, chosen by ingress.type) for
every host in ingress.hosts, with the same path map for each: /api to the gateway, sign-in paths
to identity, /socket to websocket, the rest to the web portal. A host missing from the list gets the
controller’s plain 404, before Osos sees anything.
You also own the certificate: either a Secret per host named in ingress.tls, or an annotation
for cert-manager to issue one. And the DNS record pointing the name at your ingress controller,
which the chart cannot create.
Some platforms also run the space provisioner, a shared function the release calls (at
data.config.spaceProvisioner.url) whenever a space is created, activated or deactivated. Where it
runs, it creates or removes that space’s Ingress and cert-manager certificate by itself, so you only
add the DNS record. Where it does not, as in your lab, you add the host to ingress.hosts yourself.
Layer 2: the gateway
Section titled “Layer 2: the gateway”The ingress hands /api requests to the gateway, which looks the host up in the space and domain
lists. A host in no space gets 404 SPACE_ERROR; a host in no domain gets 400 DOMAIN_ERROR. Those
lists come from the administrator’s records, so this layer is theirs to complete: you cannot fix a
SPACE_ERROR with values.
The sign-in callbacks
Section titled “The sign-in callbacks”After signing in, the identity server sends the person back to the address they came from, but only
to addresses registered on the web client. The chart registers rootHost and every subdomain of it
(*.northwind.example.com) automatically. An address outside rootHost, such as a partner
portal on its own domain, needs three entries in identity.additionalDefaultRedirectUris and the
post-logout list, before people use it, or nobody can sign in there:
https://<host>/auth-callbackhttps://<host>/auth-callback.htmlhttps://<host>The order of work
Section titled “The order of work”flowchart LR A["Administrator plans<br/>the space and sends<br/>the address"] --> B["You: DNS record<br/>and certificate"] B --> C["You: add the host<br/>to the values, plus<br/>callbacks if outside rootHost;<br/>upgrade"] C --> D["Administrator creates<br/>or activates the space<br/>and domain records"] D --> E["Both: test sign-in<br/>and data on the address;<br/>then announce"]
What to notice: each side finishes its layer before the other tests. Announcing before step E means
users meet a 404 from the controller or a SPACE_ERROR from the gateway.
▶ Guided demo (7 min) — Meet both layers with one address
Section titled “▶ Guided demo (7 min) — Meet both layers with one address”Starting state. The nw release answering on localhost. Browsers and curl send a Host
header; -H "Host: …" lets you pretend to be another address without any DNS.
- Ask for an address the ingress does not know:
curl -s -i -H "Host: customs.localhost" http://localhost/api/v1/version | head -5. The answer is404 Not Foundwith an HTML body from nginx: layer 1 refused it. - Add the host to the release. In
nw-values.yaml, underingress.hosts, add- host: customs.localhostbelow- host: localhost, thenhelm upgrade nw ./osos -n northwind $values --wait --timeout 10m. - Ask again. The answer is now
404with a JSON body:"code": "SPACE_ERROR","serviceName": "API Gateway"and atraceId. Layer 1 passed it; layer 2 knows no space on that address. - Compare with the known address:
curl -s -i http://localhost/api/v1/version | head -5. NoSPACE_ERROR: the gateway resolvedlocalhostto the root space.
Why it matters: the same status code, 404, came from two different layers. The body tells you
which: HTML from the controller, a JSON envelope from the gateway.
⛏ Lab (16 min) — Plan Northwind’s production addresses
Section titled “⛏ Lab (16 min) — Plan Northwind’s production addresses”Goal. A production values excerpt for Northwind’s three addresses, proved by a render.
Northwind’s brief.
- The main address is
northwind.example.com. - The customs desk’s space is
customs, so its address iscustoms.northwind.example.com. - Partners use a separate portal at
partners.northwind-freight.example.org, a domain Northwind owns but which is not undernorthwind.example.com. - Certificates are issued by cert-manager with the cluster issuer
northwind-issuer.
- Copy
nw-values.yamltonw-prod-values.yaml. In the copy, setrootHostto the main address. - Replace the
ingressblock with one that lists the three hosts, and one TLS entry per host with its own Secret name. Add the annotationcert-manager.io/cluster-issuer: northwind-issuer. - Decide which hosts need sign-in callbacks, and add them under
identity:asadditionalDefaultRedirectUrisandadditionalDefaultPostLogoutRedirectUris. - Render with the production file in place of the lab one:
helm template nw ./osos -n northwind -f nw-prod-values.yaml -f nw-secrets.yaml -f pack-values.yaml > prod.yaml. - Check the Ingress hosts:
grep -A40 '^kind: Ingress' prod.yaml | grep -E 'host:|secretName:'. - Check the callbacks reached the identity server’s client list:
grep -n "partners.northwind-freight.example.org" prod.yaml. - In
inventory.md, write the hand-back note to the administrator: what you did, and what they must do before anyone tests.
Check.
-
rootHostisnorthwind.example.comand the render succeeds. - The Ingress lists all three hosts, each with a TLS Secret.
- Only the partner host has callback entries, all three forms.
- Step 6 finds the partner host in the rendered identity configuration.
- Your hand-back note asks the administrator to create or activate the space and domain records, and to test before announcing.
Pass condition. Your excerpt matches the model answer in substance, and the render proves it.
If something goes wrong
| What you see | What to do |
|---|---|
| The render fails with a YAML error | ingress.hosts is a list of objects (- host: …); ingress.tls is a list with hosts and secretName. Check the dashes and indentation. |
| Step 6 finds nothing | The callback lists sit under identity:, not under identity.config:. |
| You added callbacks for the customs host | Not wrong, but unnecessary: subdomains of rootHost are registered automatically. |
Model answer
rootHost: northwind.example.comingress: className: nginx annotations: cert-manager.io/cluster-issuer: northwind-issuer hosts: - host: northwind.example.com - host: customs.northwind.example.com - host: partners.northwind-freight.example.org tls: - hosts: [northwind.example.com] secretName: nw-main-tls - hosts: [customs.northwind.example.com] secretName: nw-customs-tls - hosts: [partners.northwind-freight.example.org] secretName: nw-partners-tlsidentity: additionalDefaultRedirectUris: - https://partners.northwind-freight.example.org/auth-callback - https://partners.northwind-freight.example.org/auth-callback.html - https://partners.northwind-freight.example.org additionalDefaultPostLogoutRedirectUris: - https://partners.northwind-freight.example.org/auth-callback - https://partners.northwind-freight.example.org/auth-callback.html - https://partners.northwind-freight.example.orgHand-back note. “DNS, certificates and routing are in place for customs.northwind.example.com
and partners.northwind-freight.example.org from revision N. Before anyone uses them: create the
customs space (identifier customs) and add the partner host to the partner domain’s Host list,
with its sign-in options. Until then the platform answers SPACE_ERROR on those addresses. Then let us
test sign-in and one list together before you announce.”
The identity.ingress.enabled: false line from the lab file can stay or go: in production you may
prefer identity on its own host, which changes the callback base but not the reasoning.
✓ Practice (5 min) — Check your understanding
Section titled “✓ Practice (5 min) — Check your understanding”After your upgrade adds customs.northwind.example.com, a test request to it returns 404 with
"code": "SPACE_ERROR". What is missing?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
The partner portal opens at partners.northwind-freight.example.org, but after signing in people
land on an error instead of the portal. Lists work for people already signed in elsewhere. What did
the operator miss?
Check your answer
The correct answer is A. Open the explanation under each option to see why.
Put the work for a new space address in order.
Check your answer
The correct order is D → B → E → A → C. Open the explanation under each item to see why it sits where it does.
A request returns 404. How do you tell at once whether the ingress or the gateway answered?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
↺ Recap (1 min) — Addresses you can set up
Section titled “↺ Recap (1 min) — Addresses you can set up”You can make an address reach a space through both layers, in the right order with the administrator, and prove a production address plan with a render before you change anything.
Next. In M3-S2 you operate the gateway itself: its error answers, how to trace one, the shared key it holds with every service, and a live triage of faults you cause on purpose.