Skip to content

Commit 20759bd

Browse files
committed
docs(weather-agent): apply UI testing feedback to advanced demo
Round of fixes from a real run-through of the UI flow: - Step 2: button label is "Build & Deploy Tool" (not "Deploy Tool"); add explicit Target Port: 8000. - Step 2 / Step 3: prepend a callout that the tool/agent names MUST be the -advanced variants. Importing as plain weather-tool / weather-service silently breaks token exchange because the Service ends up as weather-tool-mcp instead of weather-tool-advanced-mcp, MCP_URL stops resolving, and the Keycloak audience scopes registered by Step 1 don't match the workload SPIFFE. - Step 3: reorder Outbound Routing Rules to come right after SPIRE, before Service Port — matches the actual import-form layout. Replace the labeled-column table with a positional 3-field list because the UI form fields are currently unlabeled. - Step 4: note that the Agent Catalog shows BOTH workloads (the advanced demo labels the tool kagenti.io/type=agent so AuthBridge gets injected; injectTools feature gate is off by default), and the Tool Catalog is empty. Without the note this looks broken. - Cleanup: also delete Shipwright Build + BuildRun. The Kagenti backend reconciliation service treats orphaned builds as "needs deployment" and re-creates the Deployment + Service + ServiceAccount within seconds, making it impossible to delete via kubectl alone. - Troubleshooting: add rows for the recreated-on-delete and wrong-MCP-URL symptoms above. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Mariusz Sabath <mrsabath@gmail.com>
1 parent 2e96753 commit 20759bd

1 file changed

Lines changed: 53 additions & 20 deletions

File tree

authbridge/demos/weather-agent/demo-ui-advanced.md

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,24 @@ the optional exchange scope. The script:
7171

7272
## Step 2: Import the Weather Tool via Kagenti UI
7373

74+
> ⚠️ **Use the `-advanced` names exactly.** **Tool Name** must be
75+
> `weather-tool-advanced` (not `weather-tool`). The Keycloak script in
76+
> Step 1 registered SPIFFE / audience scopes for the `-advanced`
77+
> ServiceAccount; if you import as `weather-tool`, the Service ends up as
78+
> `weather-tool-mcp` instead of `weather-tool-advanced-mcp` and the
79+
> `MCP_URL` + outbound route in Step 3 won't resolve.
80+
7481
1. Open [Import Tool](http://kagenti-ui.localtest.me:8080/tools/import).
75-
2. **Namespace**: `team1` · **Tool Name**: `weather-tool-advanced`.
82+
2. **Namespace**: `team1` · **Tool Name**: `weather-tool-advanced` (exact).
7683
3. **Deploy From Image** · **Container Image**:
7784
`ghcr.io/kagenti/agent-examples/weather_tool` · **Image Tag**: `latest`.
7885
4. **MCP Transport Protocol**: `streamable HTTP`.
7986
5. **Enable AuthBridge sidecar injection**: ✅ **check** (advanced demo
8087
validates JWTs at the tool's ingress — this is the difference vs. the
8188
standard demo).
8289
6. **Enable SPIRE identity (spiffe-helper sidecar)**: ✅ **check**.
83-
7. **Service Port** `8000`.
84-
8. Click **Deploy Tool**.
90+
7. **Service Port** `8000` · **Target Port** `8000`.
91+
8. Click **Build & Deploy Tool**.
8592

8693
Wait for the tool pod to be **Ready**. Once it registers in Keycloak, the
8794
`setup_keycloak_weather_advanced.py` from Step 1 unblocks.
@@ -109,10 +116,16 @@ kubectl create secret generic openai-secret -n team1 \
109116
> exported), the agent fails with `Error: No LLM API key configured.` — see
110117
> [Troubleshooting](#troubleshooting).
111118
112-
Now the UI flow:
119+
> ⚠️ **Use the `-advanced` name exactly.** **Agent Name** must be
120+
> `weather-service-advanced` (not `weather-service`). The Keycloak script
121+
> in Step 1 registered SPIFFE / audience scopes for the `-advanced`
122+
> ServiceAccount; the wrong name lands you with mismatched audiences and
123+
> a 401/503 from token exchange.
124+
125+
Now the UI flow (order matches the actual import form top-to-bottom):
113126

114127
1. Open [Import Agent](http://kagenti-ui.localtest.me:8080/agents/import).
115-
2. **Namespace**: `team1` · **Agent Name**: `weather-service-advanced`.
128+
2. **Namespace**: `team1` · **Agent Name**: `weather-service-advanced` (exact).
116129
3. **Build from Source**:
117130
- Git Repository URL: `https://github.com/kagenti/agent-examples`
118131
- Git Branch or Tag: `main`
@@ -122,8 +135,23 @@ Now the UI flow:
122135
`Deployment`.
123136
5. **Enable AuthBridge sidecar injection**: ✅ (default).
124137
6. **Enable SPIRE identity**: ✅ (default).
125-
7. **Service Port** `8080`, **Target Port** `8000`.
126-
8. Under **Environment Variables**, click **Import from File/URL****From
138+
7. Expand **Outbound Routing Rules** and add one route — this is what
139+
triggers the RFC 8693 exchange when the agent calls the tool. The form
140+
has three fields (currently unlabeled in the UI); fill them in this
141+
order:
142+
143+
1. Host: `weather-tool-advanced-mcp`
144+
2. Target Audience: `spiffe://localtest.me/ns/team1/sa/weather-tool-advanced`
145+
3. Token Scopes: `openid weather-tool-exchange-aud`
146+
147+
> If **Outbound Routing Rules** is missing or unresponsive, your Kagenti
148+
> backend may pre-date [kagenti#1194](https://github.com/kagenti/kagenti/pull/1194).
149+
> Apply the equivalent ConfigMap with kubectl (
150+
> `kubectl apply -f authbridge/demos/weather-agent/k8s/configmaps-advanced.yaml`)
151+
> and skip this expander. Same content, list-shaped `routes.yaml`.
152+
153+
8. **Service Port** `8080` · **Target Port** `8000`.
154+
9. Under **Environment Variables**, click **Import from File/URL****From
127155
URL**, paste one of the beginner agent's env files, and click
128156
**Fetch & Parse**:
129157
- OpenAI: `https://raw.githubusercontent.com/kagenti/agent-examples/refs/heads/main/a2a/weather_service/.env.openai`
@@ -137,19 +165,6 @@ Now the UI flow:
137165
```
138166
MCP_URL=http://weather-tool-advanced-mcp:8000/mcp
139167
```
140-
9. Expand **Outbound Routing Rules** and add one route — this is what triggers
141-
the RFC 8693 exchange when the agent calls the tool:
142-
143-
| Host | Target Audience | Token Scopes |
144-
|------|----------------|--------------|
145-
| `weather-tool-advanced-mcp` | `spiffe://localtest.me/ns/team1/sa/weather-tool-advanced` | `openid weather-tool-exchange-aud` |
146-
147-
> If **Outbound Routing Rules** is missing or unresponsive, your Kagenti
148-
> backend may pre-date [kagenti#1194](https://github.com/kagenti/kagenti/pull/1194).
149-
> Apply the equivalent ConfigMap with kubectl (
150-
> `kubectl apply -f authbridge/demos/weather-agent/k8s/configmaps-advanced.yaml`)
151-
> and skip this expander. Same content, list-shaped `routes.yaml`.
152-
153168
10. **(Ollama only)** Expand **AuthBridge Advanced Configuration** and set
154169
**Outbound Ports to Exclude** to `11434`. OpenAI uses HTTPS and needs no
155170
exclusion.
@@ -166,6 +181,14 @@ python demos/weather-agent/setup_keycloak_weather_advanced.py -n team1
166181

167182
## Step 4: Chat via Kagenti UI
168183

184+
> **Expected catalog quirk.** The **Agent Catalog** shows **two** entries:
185+
> `weather-service-advanced` *and* `weather-tool-advanced`. The **Tool
186+
> Catalog** is empty. This is by design — the advanced demo labels the
187+
> tool with `kagenti.io/type: agent` so AuthBridge gets injected on it
188+
> (the `injectTools` feature gate is off by default; see the
189+
> [kubectl appendix](#operator-gotchas)). Pick `weather-service-advanced`
190+
> for chat.
191+
169192
1. **Agent Catalog** → namespace `team1``weather-service-advanced`
170193
**View Details**. The agent card should render (proves the agent is up and
171194
`/.well-known/*` is bypassed).
@@ -234,6 +257,8 @@ Useful env knobs:
234257
| Token exchange denied | Tool client missing `standard.token.exchange.enabled` | Re-run setup with `--wait-tool-client` after the tool pod registers. |
235258
| Tool pod CrashLoopBackOff (`mcp` container) | The `weather_tool` image runs as UID 1001; a `securityContext` overriding the user breaks `uv run` | Use the manifests in `k8s/` as-is (they set `runAsUser/Group/fsGroup: 1001`). On OpenShift, see the [upstream Dockerfile](https://github.com/kagenti/agent-examples/blob/main/mcp/weather_tool/Dockerfile). |
236259
| Tool ingress logs missing `[Inbound]` | Combined sidecar uses different log text | Grep for `Token validated` instead, or increase log window. |
260+
| Deleted the agent or tool, but the Deployment + Service reappear within seconds | The Kagenti backend's reconciliation service finalizes "orphaned" Shipwright builds by re-creating workloads | Also delete the Shipwright `Build` and `BuildRun` (see the [Cleanup](#cleanup) snippet). |
261+
| Chat returns `Cannot connect to MCP weather service at http://weather-tool-advanced-mcp:8000/mcp` | UI import used the standard names (`weather-tool` / `weather-service`) instead of `-advanced`, so the actual Service is `weather-tool-mcp` and `MCP_URL` doesn't resolve | Re-import using the exact `-advanced` names. The Keycloak script from Step 1 also expects those names. |
237262

238263
Tool ingress and agent outbound logs (container name varies by AuthBridge mode
239264
`authbridge-proxy` for proxy-sidecar default, `envoy-proxy` for envoy-sidecar):
@@ -254,6 +279,14 @@ kubectl delete deployment,svc,sa -n team1 \
254279
-l app.kubernetes.io/name=weather-service-advanced --ignore-not-found
255280
kubectl delete deployment,svc,sa -n team1 \
256281
-l app.kubernetes.io/name=weather-tool-advanced --ignore-not-found
282+
283+
# Also delete the Shipwright Build/BuildRun, otherwise the Kagenti
284+
# backend's reconciliation service treats them as "orphaned" and
285+
# recreates the Deployment + Service + ServiceAccount within seconds:
286+
kubectl delete build.shipwright.io,buildrun.shipwright.io -n team1 \
287+
-l app.kubernetes.io/name=weather-service-advanced --ignore-not-found
288+
kubectl delete build.shipwright.io,buildrun.shipwright.io -n team1 \
289+
-l app.kubernetes.io/name=weather-tool-advanced --ignore-not-found
257290
```
258291

259292
Keycloak clients for the SPIFFE IDs can be removed from the admin console.

0 commit comments

Comments
 (0)