Skip to content

feat: inject projected SA token volume into sandbox pods#7

Merged
pdettori merged 1 commit into
mainfrom
fix/projected-sa-token
Jun 4, 2026
Merged

feat: inject projected SA token volume into sandbox pods#7
pdettori merged 1 commit into
mainfrom
fix/projected-sa-token

Conversation

@pdettori
Copy link
Copy Markdown

@pdettori pdettori commented Jun 4, 2026

Summary

  • Add projected serviceAccountToken volume with audience openshell-gateway to sandbox pods
  • Mount at /var/run/secrets/openshell/token (read-only, mode 0400)
  • Set OPENSHELL_K8S_SA_TOKEN_FILE env var so the supervisor finds the token
  • New CLI flags: -sa-token-audience (default openshell-gateway), -sa-token-ttl-secs (default 3600)

Context

The mvp-v2 gateway validates sandbox SA tokens via K8s TokenReview with audience
openshell-gateway. The default K8s SA token carries the wrong audience
(https://kubernetes.default.svc.cluster.local), causing authentication failure.

This matches the upstream in-tree driver implementation at
kagenti/OpenShell@mvp-v2:crates/openshell-driver-kubernetes/src/driver.rs.

Fixes: kagenti/kagenti#1815

Test plan

  • Unit tests pass (go test ./...)
  • Deploy with Kind full test
  • Verify sandbox supervisor connects to gateway successfully

Assisted-By: Claude Code

The gateway's K8s SA authenticator requires tokens with audience
"openshell-gateway". Add a projected serviceAccountToken volume to
sandbox pods and set OPENSHELL_K8S_SA_TOKEN_FILE so the supervisor
can authenticate back to the gateway via IssueSandboxToken.

New CLI flags:
  -sa-token-audience  (default: "openshell-gateway")
  -sa-token-ttl-secs  (default: 3600)

Fixes: kagenti/kagenti#1815

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori pdettori merged commit 28bb43c into main Jun 4, 2026
4 checks passed
@pdettori pdettori deleted the fix/projected-sa-token branch June 4, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openshell-driver-openshift: supervisor init and sandbox token issues with mvp-v2 images

1 participant