Repository navigation
Feat(scripts): add --enable-spiffe-auth flag - #2188
Conversation
161269c to
6c92f0d
Compare
|
The goal of this PR to help simplify setting up SPIFFE auth in Kagenti. |
clawgenti
left a comment
There was a problem hiding this comment.
Adds --enable-agent-spiffe-auth and --enable-spiffe-auth convenience flags to setup-kagenti.sh, with matching --with-spire guards and updated help text. Changes are minimal, well-scoped, and consistent with existing patterns.
All checks pass. Ready for human review.
Reviewed by clawgenti using github:pr-review
clawgenti
left a comment
There was a problem hiding this comment.
Shell script adds --enable-agent-spiffe-auth, --enable-spiffe-auth convenience flags, proper --with-spire guard validation, and wires authBridge.clientAuthType and kagenti-operator-chart.spiffe.enabled into the Helm flags. All checks pass. Ready for human review.
Reviewed by clawgenti using github:pr-review
|
The |
mrsabath
left a comment
There was a problem hiding this comment.
Clean, well-gated change. Adds --enable-agent-spiffe-auth + --enable-spiffe-auth shorthand and a --with-spire guard for both SPIFFE flags.
Verified against kagenti@main and kagenti-operator@main: the subchart keys (spiffe.enabled, spiffe.operatorAuth.enabled, keycloak.publicUrl) all exist, keycloak.publicUrl is genuinely required by the subchart (it derives the JWT audience from it — subcharts don't inherit parent values), dual-mode parity holds (the client-secret off-path exactly matches the chart default at charts/kagenti/values.yaml:295, so it's a true no-op when disabled), and both guards are sound.
CI note: "Deploy & Test" is red, but the failure is a cross-repo Python dependency conflict (langchain-core==1.4.8 → ResolutionImpossible) in kagenti-extensions@main's advanced weather demo (deploy_and_verify_advanced.sh runs a pip install). It is not caused by this PR, which only edits a shell script — no requirements.txt is touched. The same failure hits unrelated PR branches (feat/simulated-tool-*), confirming it's environmental. The published pytest JUnit suites all passed (0 failures / 0 errors).
Areas reviewed: Shell, Helm value wiring (cross-repo verified), CI. Commits: 2, all signed-off (DCO green). CI: failing on an unrelated cross-repo dependency conflict.
Comments below are all non-blocking (2 suggestions, 1 nit).
mrsabath
left a comment
There was a problem hiding this comment.
Re-approving on the new HEAD (33bdb6c). This re-review covers only the delta since my approval at 2b49ad5 — one new commit plus your responses to my earlier feedback.
Delta
The entire change since my approval is a single line added to KAGENTI_FLAGS:
--set "spire.enabled=${WITH_SPIRE}"This is exactly the nit I raised at line 1226. Verified against upstream/main:
| Check | Result |
|---|---|
| Guard rationale | ✓ _helpers.tpl:99-100 does fail when clientAuthType=federated-jwt && spire.enabled=false — the commit message is accurate |
| Default masking | ✓ chart default is spire.enabled: true (values.yaml:471); the explicit set is robust to a future default flip |
| Value safety | ✓ WITH_SPIRE is a clean bash true/false (init false, set true by --with-spire) — safe to interpolate |
| No key collision | ✓ top-level spire.enabled (kagenti chart) is distinct from components.spire.enabled at ~L744 (deps chart) — two different helm invocations, both legitimate |
Follow-up feedback resolution
- nit — explicit
spire.enabled→ ✅ addressed by33bdb6c - suggestion — title overstated a "guide" → ✅ title trimmed to
Feat(scripts): add --enable-spiffe-auth flag - suggestion — operator path is a no-op until a new OCI release → ✅ acknowledged; fixed on the next operator tag
CI: all green except "Deploy & Test", which is re-running on the new commit — and per my prior review that job fails on an unrelated cross-repo Python dependency conflict in kagenti-extensions@main, not this PR (which only edits a shell script).
Verdict: APPROVE — every point from my earlier review is now resolved. Nice and tidy.
Areas reviewed (delta): Shell, Helm value wiring (cross-repo verified). New commits: 1, signed-off (DCO green).
…and SPIRE guard - --enable-agent-spiffe-auth: sets authBridge.clientAuthType=federated-jwt so agent/tool workloads authenticate to Keycloak via SPIFFE JWT-SVID instead of pre-provisioned client secrets - --enable-spiffe-auth: convenience shorthand that enables both operator and agent SPIFFE auth in one flag - Guard: --enable-operator-spiffe-auth and --enable-agent-spiffe-auth both now fail immediately with a clear error if --with-spire is not set, rather than letting the bootstrap job fail silently at runtime Signed-off-by: Alan Cha <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
…subchart When --enable-operator-spiffe-auth is set: - spiffe.enabled must also be set (the sidecar template requires both spiffe.enabled AND spiffe.operatorAuth.enabled) - keycloak.publicUrl must be passed to the subchart explicitly (Helm subcharts do not inherit parent chart values; the subchart template uses it to derive the JWT audience for spiffe-helper) Signed-off-by: Alan Cha <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
The _helpers.tpl guard fails the chart render when authBridge.clientAuthType=federated-jwt but spire.enabled=false. Today this is satisfied by the chart default (spire.enabled=true), but the script never set it explicitly — a future default change would break silently. Make the dependency self-documenting. Signed-off-by: Alan Cha <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
33bdb6c to
afb3b28
Compare
mrsabath
left a comment
There was a problem hiding this comment.
Reviewed the shell changes to scripts/kind/setup-kagenti.sh (26 additions, 1 deletion). Small, well-gated, backward-compatible.
Verified against main in both repos:
- All three new
--setkey paths resolve to real chart values:authBridge.clientAuthType(umbrellakagentichart, consumed atvalues.yaml:320),kagenti-operator-chart.spiffe.enabledandkagenti-operator-chart.keycloak.publicUrl(operator chartvalues.yaml:204/:113), and top-levelspire.enabled(umbrellavalues.yaml:470). WITH_SPIREguards run after arg-parse; the$(bool && echo … || echo …)ternary isset -e-safe in both branches.bash -nclean; Shell Script Lint and all lint/chart/test checks pass; 3 commits, all signed-off.
Note: Deploy & Test is red, but the cause is unrelated to this PR — a Python dependency conflict in the weather example (langchain-core==1.4.8 → ResolutionImpossible, "AuthBridge Weather (advanced) E2E failed"). This PR touches no Python/requirements files. Worth resolving separately if that check is required for merge.
LGTM.
Signed-off-by: Alan Cha <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
Summary
Adds three new flags to
setup-kagenti.shfor enabling SPIFFE-based Keycloak authentication. Tracks #2174.Changes
--enable-operator-spiffe-auth— operator authenticates to Keycloak using JWT-SVID instead of admin credentials. Setskagenti-operator-chart.spiffe.operatorAuth.enabled=true. Requires--with-spire.--enable-agent-spiffe-auth— agent/tool workloads authenticate using JWT-SVID (authBridge.clientAuthType=federated-jwt). Requires--with-spire.--enable-spiffe-auth— convenience shorthand that sets both.--with-spireis not passed.Dependency
--enable-operator-spiffe-authrequires akagenti-operator-chartOCI release that includes the conditional spiffe-helper sidecar template from kagenti-operator#473. That PR is merged to main but a new chart version has not been published yet. The current OCI chart (0.3.0-alpha.6) predates it, so the flag is a no-op until a new release is cut.Related
kagenti-operator-chartOCI releaseChecklist
Assisted-By: Claude Code