Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

kubelogin

$ kubelogin Community Low Risk
int128 · Cloud & Infra · Apache-2.0 · macos / linux / windows

kubelogin (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.

FCRS-1.0 Score
73 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
brew install kubelogin
CLI vs MCP Decision CLI Only

kubelogin is a low-level kubectl exec credential plugin; MCP servers cannot drive local browser OIDC PKCE callbacks for kubeconfig.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
— Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

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-token emits ExecCredential JSON for kubectl
  • Browser authcode flow blocks in headless non-TTY environments
Trust & Safety 21 / 25

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
Setup & Portability 14 / 15

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
Utility & Efficiency 10 / 15

Transparently handles OIDC token refresh for kubectl, though its scope is strictly cluster auth bootstrapping.

  • Automated refresh token handling for kubectl exec auth
Maintenance & Lineage 6 / 10

Well-established community project (int128/kubelogin) under Apache-2.0, though maintained outside Kubernetes SIGs.

  • Community int128/kubelogin repo under Apache-2.0
Docs & Verifiability 6 / 10

Clear GitHub README and setup docs, though formula name collision with Azure kubelogin causes frequent confusion.

  • GitHub docs cover setup, get-token, and clean

Security, Auth & Guardrails

Auth Modes
OAuth Browser OS Keychain Config File
Credential Storage

Caches OIDC tokens in ~/.kube/cache/oidc-login (or OS keychain via --token-cache-storage=keyring).

Side Effects
Read-Only Local Write
Cost & Quotas

CLI is free (Apache-2.0); uses existing OIDC identity provider.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Verify plugin version and options
kubelogin --version && kubelogin get-token --help

Confirms installed binary version and inspects OIDC flags without triggering browser login.

Controlled Writes & Previews

Run OIDC setup and inspect token claims
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=keyring and PKCE S256 for secure local OIDC caching.
  • + Works seamlessly as a kubectl exec 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/kubelogin can confuse users and scripts.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI