Skip to content

Commit dd5691b

Browse files
committed
docs(demo): update github-agent spec for AgentCard auto-creation prerequisites
§7 Deployment: - Add protocol.kagenti.io/a2a label requirement on both Deployment metadata.labels and pod template; explain it gates AgentCardSyncReconciler.shouldSyncWorkload() (operator stamps kagenti.io/type=agent but not the protocol label) - Replace single Service port 8080→8000 with two-port shape: agent:8001→8001 first (direct path past authbridge proxy, used by AgentCardReconciler for card fetch), proxy:8080→8000 second (authenticated path for A2A clients); document why port order matters (getServicePort() always takes Ports[0]) §8 Verification step 8: add AgentCard CR auto-creation check Signed-off-by: Oleg Blinder <olegb@il.ibm.com>
1 parent a81869a commit dd5691b

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

aiac/docs/specs/demo/github-agent.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,23 @@ Manifests live under `aiac/demo/agents/github_agent/k8s/`, adapted from the gith
199199
`team1` (installer-provided ConfigMaps/secrets assumed present).
200200

201201
- **`github-agent-deployment.yaml`**`ServiceAccount` + `Deployment` + `Service` + `AgentRuntime`:
202-
- Pod labels `kagenti.io/inject: enabled`, `kagenti.io/spire: enabled`.
202+
- **Deployment labels** (on `metadata.labels` **and** pod template): `protocol.kagenti.io/a2a: ""`
203+
in addition to `app.kubernetes.io/name: github-agent`. The `protocol.kagenti.io/a2a` label is
204+
required by the `AgentCardSyncReconciler` (`shouldSyncWorkload` gate): the operator stamps
205+
`kagenti.io/type=agent` automatically via the `AgentRuntime`, but the protocol label must be set
206+
in the manifest. Without it, no `AgentCard` CR is auto-created and `analyze_agent` falls back to
207+
the default minimal scope.
208+
- Pod labels `kagenti.io/inject: enabled`, `kagenti.io/spire: enabled`, `protocol.kagenti.io/a2a: ""`.
203209
- Container port `8000`; env `MCP_URL=http://github-tool-mcp:9090/mcp`,
204210
`JWKS_URI=http://keycloak-service.keycloak.svc:8080/realms/kagenti/protocol/openid-connect/certs`,
205211
LLM vars, `PORT`, `LOG_LEVEL`; `/shared` `emptyDir` for operator-mounted client creds.
206-
- `Service` `8080 → 8000` (ClusterIP).
212+
- `Service` (ClusterIP) with **two ports** — port order matters because
213+
`AgentCardReconciler.getServicePort()` always takes `Ports[0]`:
214+
1. `agent: 8001 → 8001` (first) — direct path to the agent after authbridge port-stealing
215+
(`8000 → 8001`); used by the operator's `AgentCardReconciler` to fetch `/.well-known/agent.json`
216+
without going through the authbridge reverse proxy (which blocks unauthenticated requests).
217+
2. `proxy: 8080 → 8000` (second) — the public/authenticated path through the authbridge reverse
218+
proxy; used by A2A clients that carry a valid JWT.
207219
- `AgentRuntime{ type: agent, targetRef: this Deployment }` — enrolls the workload (operator applies
208220
`kagenti.io/type=agent`, registers a Keycloak client, injects the AuthBridge sidecar).
209221
- Image `github-agent:latest`, `imagePullPolicy: IfNotPresent` (kind-load; name is a documented knob).
@@ -240,7 +252,9 @@ Service name; exchanged audience (`github-tool`) == tool `AUDIENCE`.
240252
5. `kind load docker-image github-agent:latest --name kagenti`.
241253
6. Ensure `github-tool` + `github-tool-secrets` exist in `team1`.
242254
7. `kubectl apply -f k8s/configmaps.yaml -f k8s/github-agent-deployment.yaml`.
243-
8. Confirm AuthBridge injection + `kagenti.io/type=agent`; `kubectl port-forward svc/github-agent 8080:8080 -n team1`;
255+
8. Confirm AuthBridge injection + `kagenti.io/type=agent`; confirm the `AgentCard` CR was
256+
auto-created (`kubectl get agentcard -n team1` → `github-agent-deployment-card`, `SYNCED=True`).
257+
`kubectl port-forward svc/github-agent 8080:8080 -n team1` (proxy port);
244258
send an authenticated A2A message; verify token exchange reaches `github-tool` and an answer returns.
245259

246260
---

0 commit comments

Comments
 (0)