Kubernetes ServiceAccount Tokens Used as Forgejo Identities via oauth2-proxy

A developer running a coding-agent platform on Kubernetes replaced per-agent Personal Access Tokens with workload identity. Each agent runs as a Kubernetes Job and needs to authenticate to the Forgejo Git host to push branches and open pull requests. Instead of storing a long-lived token, the agent pod mounts a projected ServiceAccount token scoped to an audience that only the gate in front of Forgejo accepts. The gate, built on oauth2-proxy, verifies the JWT and forwards the identity to Forgejo, making each run traceable to its ServiceAccount. The article also covers how the Kubernetes API server acts as a verification-only OIDC issuer, which complicates standard client libraries.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in