Repository navigation
docs: symmetric authentication guide covering client-secrets and SPIFFE - #2211
Conversation
…n.md
- Create docs/authentication.md covering both auth modes with equal depth:
- Client secrets (default): admin credential flow, provisioning,
break-glass sync, how-it-works diagram
- SPIFFE auth (recommended): JWT-SVID/Keycloak mechanics, operator
bootstrap job flow, agent flow, prerequisites, Helm values
- Shared sections: verification commands for both modes, troubleshooting
- Simplify docs/install.md: replace the verbose
'Keycloak Admin Credentials for Agent Namespaces' section with a
two-sentence summary that links to authentication.md
- scripts/ocp/setup-kagenti.sh: remove orphaned KC_ADMIN_FLAGS block
(keycloak.adminUsername / keycloak.adminPassword chart values do not
exist in templates; the bootstrap Job reads credentials directly from
the keycloak-initial-admin Secret)
Supersedes PR #2155 and PR #2208.
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Alan Cha <[email protected]>
mrsabath
left a comment
There was a problem hiding this comment.
Review
Verified every technical claim in docs/authentication.md against kagenti/kagenti@main and kagenti/kagenti-operator@main (chart values, the agent-oauth-secret-job template + its Python source, the setup-kagenti.sh flags, and the operator's client-registration code). Most of the doc is accurate. Two related claims about where keycloak-admin-secret comes from are wrong, and they undercut the PR's own goal — #2155 was literally "fix stale keycloak-admin-secret docs."
Verified accurate (no changes needed): the three setup-kagenti.sh flags + fail-without---with-spire behavior; keycloak.adminSecretName/adminUsernameKey/adminPasswordKey values exist; the operator's kagenti-keycloak-client-credentials-* naming used in the verification greps; and the removal of the non-existent keycloak.adminUsername/adminPassword/adminExistingSecret from install.md and the script is correct.
Areas reviewed: Docs (authentication.md, install.md), Shell (setup-kagenti.sh), cross-repo source verification.
Commits: 1 commit, signed-off: yes (DCO passing).
CI status: passing (Deploy & Test pending at review time).
Two must-fix accuracy issues inline. Fixes are small (2 paragraphs).
Minor (non-blocking, no inline): the body's Closes #2155/Closes #2208 reference already-closed PRs, not open issues, so they're no-ops — consider "Supersedes" wording only.
- Step 1: the agent-oauth-secret-job creates kagenti-keycloak-client-secret in each agent namespace, not keycloak-admin-secret in kagenti-system - Step 2: operator reads keycloak-initial-admin directly, not via an intermediate secret - Remove incorrect break-glass procedure (recreating keycloak-admin-secret and re-running helm upgrade had no effect on the data flow); replace with operator restart + log verification Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
|
Both must-fix comments addressed in c4f1e7d: Comment 1 (line 20): Step 1 now correctly says the Comment 2 (line 56): The break-glass section has been replaced with an operator restart + log verification. The incorrect On the minor note about |
mrsabath
left a comment
There was a problem hiding this comment.
Re-review — both must-fix items addressed ✅
Commit c4f1e7d fixes both accuracy issues from my prior review, and I verified each fix against the actual code:
-
Client-secrets "How it works" (step 1 & 2) — now correctly states the
kagenti-agent-oauth-secret-jobcreateskagenti-keycloak-client-secretper agent namespace (matcheskagenti/auth/agent-oauth-secret/agent_oauth_secret.py), and that theClientRegistrationReconcilerreadskeycloak-initial-admindirectly (matcheskagenti-operator/internal/controller/clientregistration_controller.go:46,100). The stalekeycloak-admin-secret in kagenti-systemclaim is gone. -
Break-glass — rewritten to
kubectl rollout restart deployment/kagenti-controller-manager -n kagenti-system+ a log-based verify, so it re-readskeycloak-initial-adminvia the operator. Deployment name confirmed in operatormanager.yaml(kagenti-controller-manager); correct data flow.
No new inaccuracies introduced; the rest of the PR is unchanged and was already verified accurate (setup-kagenti.sh SPIFFE flags, keycloak.adminSecretName/key values, operator kagenti-keycloak-client-credentials-* naming, and removal of the non-existent keycloak.adminUsername/adminPassword/adminExistingSecret).
CI: passing (Deploy & Test pending at review time). Commits: 2, signed-off (DCO passing). LGTM.
Summary
New file
docs/authentication.md— comprehensive guide covering both Keycloak auth modes with equal depth:jwt-spiffeassertion type), operator bootstrap job flow with diagram, agent flow with diagram, prerequisites (--with-spire,keycloak.publicUrl),setup-kagenti.shflags, Helm valuesdocs/install.md— replaced the verbose "Keycloak Admin Credentials for Agent Namespaces" section (which described the old stale-credential mechanism) with a brief two-sentence summary that links toauthentication.mdscripts/ocp/setup-kagenti.sh— removed orphanedKC_ADMIN_FLAGSblock (keycloak.adminUsername/keycloak.adminPasswordchart values don't exist in templates; the bootstrap Job reads credentials directly from thekeycloak-initial-adminSecret)Supersedes / Closes
keycloak-admin-secretdocs and orphaned Helm flags — the root cause section is now accurately documented inauthentication.md)Doc testing
The token exchange command in
docs/authentication.mdwas verified against a running Kind cluster:All grep patterns (operator logs, agent ConfigMap, credential secret listing) were verified against actual cluster output.
Test plan
docs/authentication.mdend-to-end — both sections have equivalent depth and no gapsinstall.mdKeycloak section links correctly toauthentication.mdscripts/ocp/setup-kagenti.shhelm upgrade still works (no orphaned flags)Assisted-By: Claude Code