kubelogin
$ kubelogin Community Low Riskkubelogin (int128/kubelogin, invoked as kubectl oidc-login) acts as a kubectl client-go exec credential plugin for OIDC identity providers. It caches ID/refresh tokens locally or in the OS keyring and prints ExecCredential JSON for kubectl.
brew install kubelogin kubelogin is a low-level kubectl exec credential plugin; MCP servers cannot drive local browser OIDC PKCE callbacks for kubeconfig.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
get-token outputs Kubernetes ExecCredential JSON automatically when cached tokens are valid, but expired sessions block waiting for interactive browser or device-code login.
get-tokenemitsExecCredentialJSON forkubectl- Browser
authcodeflow blocks in headless non-TTY environments
Supports PKCE (--oidc-pkce-method=S256) and OS keychain storage (--token-cache-storage=keyring) with zero remote cluster mutation.
- OS keyring caching via
--token-cache-storage=keyring - PKCE S256 support
Single Go binary installable via Homebrew Core (brew install kubelogin), Krew (kubectl krew install oidc-login), or GitHub releases across macOS, Linux, and Windows.
- Cross-platform binary in Homebrew Core and Krew
Transparently handles OIDC token refresh for kubectl, though its scope is strictly cluster auth bootstrapping.
- Automated refresh token handling for
kubectlexec auth
Well-established community project (int128/kubelogin) under Apache-2.0, though maintained outside Kubernetes SIGs.
- Community
int128/kubeloginrepo under Apache-2.0
Clear GitHub README and setup docs, though formula name collision with Azure kubelogin causes frequent confusion.
- GitHub docs cover
setup,get-token, andclean
Security, Auth & Guardrails
Caches OIDC tokens in ~/.kube/cache/oidc-login (or OS keychain via --token-cache-storage=keyring).
CLI is free (Apache-2.0); uses existing OIDC identity provider.
# kubelogin Agent Rules - Never invoke `kubelogin setup` or `get-token` in headless sandboxes without a cached token or user browser. - Prefer `--token-cache-storage=keyring` over plaintext file cache on shared hosts. - Note that `brew install kubelogin` installs `int128/kubelogin`, not Azure's `kubelogin`.
Agent-Ready Command Recipes
Safe Read-Only Queries
kubelogin --version && kubelogin get-token --help
Confirms installed binary version and inspects OIDC flags without triggering browser login.
Controlled Writes & Previews
kubectl oidc-login setup --oidc-issuer-url=https://accounts.google.com --oidc-client-id=<client-id> --oidc-pkce-method=S256
Launches browser PKCE login and writes cached OIDC credentials so subsequent kubectl calls authenticate.
Strengths for Agents
- + Supports
--token-cache-storage=keyringand PKCE S256 for secure local OIDC caching. - + Works seamlessly as a
kubectlexec plugin once tokens are cached. - + Available in Homebrew Core, Krew, and release archives across all major OSes.
Caveats & Pitfalls
- ! Initial login or expired refresh tokens trigger an interactive browser OAuth flow that stalls headless agents.
- ! Name collision with Microsoft's
Azure/kubelogincan confuse users and scripts.