Skip to content

M3-S1 — Web addresses for the tenant and its spaces

Section titled “M3-S1 — Web addresses for the tenant and its spaces”
ModuleM3 — Addresses and the gateway
After this session you canMake 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.
TimeFacilitated: 33 min · On your own: 33 min
Before you startM2-S3: the nw release at its last good revision. From ACSA: spaces and domains.
Go deeperSpaces & 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.

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.

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.

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-callback
https://<host>/auth-callback.html
https://<host>
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.

  1. 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 is 404 Not Found with an HTML body from nginx: layer 1 refused it.
  2. Add the host to the release. In nw-values.yaml, under ingress.hosts, add - host: customs.localhost below - host: localhost, then helm upgrade nw ./osos -n northwind $values --wait --timeout 10m.
  3. Ask again. The answer is now 404 with a JSON body: "code": "SPACE_ERROR", "serviceName": "API Gateway" and a traceId. Layer 1 passed it; layer 2 knows no space on that address.
  4. Compare with the known address: curl -s -i http://localhost/api/v1/version | head -5. No SPACE_ERROR: the gateway resolved localhost to 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 is customs.northwind.example.com.
  • Partners use a separate portal at partners.northwind-freight.example.org, a domain Northwind owns but which is not under northwind.example.com.
  • Certificates are issued by cert-manager with the cluster issuer northwind-issuer.
  1. Copy nw-values.yaml to nw-prod-values.yaml. In the copy, set rootHost to the main address.
  2. Replace the ingress block with one that lists the three hosts, and one TLS entry per host with its own Secret name. Add the annotation cert-manager.io/cluster-issuer: northwind-issuer.
  3. Decide which hosts need sign-in callbacks, and add them under identity: as additionalDefaultRedirectUris and additionalDefaultPostLogoutRedirectUris.
  4. 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.
  5. Check the Ingress hosts: grep -A40 '^kind: Ingress' prod.yaml | grep -E 'host:|secretName:'.
  6. Check the callbacks reached the identity server’s client list: grep -n "partners.northwind-freight.example.org" prod.yaml.
  7. In inventory.md, write the hand-back note to the administrator: what you did, and what they must do before anyone tests.

Check.

  • rootHost is northwind.example.com and 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 seeWhat to do
The render fails with a YAML erroringress.hosts is a list of objects (- host: …); ingress.tls is a list with hosts and secretName. Check the dashes and indentation.
Step 6 finds nothingThe callback lists sit under identity:, not under identity.config:.
You added callbacks for the customs hostNot wrong, but unnecessary: subdomains of rootHost are registered automatically.
Model answer
rootHost: northwind.example.com
ingress:
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-tls
identity:
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.org

Hand-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”
PracticeChoose one answer.

After your upgrade adds customs.northwind.example.com, a test request to it returns 404 with "code": "SPACE_ERROR". What is missing?

  1. Explanation for A

    ✗ Incorrect

    Not this one: a host missing from the Ingress gets the controller’s HTML 404, not a JSON envelope. See Layer 1: the ingress.

  2. Explanation for B

    ✓ Correct

    Correct: the gateway only knows addresses that appear in the space list. See Layer 2: the gateway.

  3. Explanation for C

    ✗ Incorrect

    Not this one: subdomains of rootHost are registered automatically, and callbacks affect sign-in, not the space lookup. See The sign-in callbacks.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

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?

  1. Explanation for A

    ✓ Correct

    Correct: an address outside rootHost must be registered before sign-in can return to it. See The sign-in callbacks.

  2. Explanation for B

    ✗ Incorrect

    Not this one: without a certificate the browser would warn before the page even opened. See Layer 1: the ingress.

  3. Explanation for C

    ✗ Incorrect

    Not this one: a host missing from the domain list fails at the gateway for every request, not only after sign-in. See Layer 2: the gateway.

Check your answer

The correct answer is A. Open the explanation under each option to see why.

PracticePut the items in the right order.

Put the work for a new space address in order.

  1. Explanation for A

    Belongs in position 4 of 5

    Fourth, so the gateway can resolve the address to the space. See The order of work.

  2. Explanation for B

    Belongs in position 2 of 5

    Second, because nothing reaches the cluster without them. See The order of work.

  3. Explanation for C

    Belongs in position 5 of 5

    Last, because only a test on the real address proves both layers. See The order of work.

  4. Explanation for D

    Belongs in position 1 of 5

    First, because the address comes from the space’s identifier and domain. See The order of work.

  5. Explanation for E

    Belongs in position 3 of 5

    Third, so the ingress routes the address to the platform. See The order of work.

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.

PracticeChoose one answer.

A request returns 404. How do you tell at once whether the ingress or the gateway answered?

  1. Explanation for A

    ✗ Incorrect

    Not this one: both can answer 404. See Meet both layers with one address.

  2. Explanation for B

    ✓ Correct

    Correct: the gateway always answers with its error envelope, which also carries a traceId. See Meet both layers with one address.

  3. Explanation for C

    ✗ Incorrect

    Not this one: timing is not a reliable signal. See Meet both layers with one address.

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.