K8sGPT
$ k8sgpt Foundation Med Riskk8sgpt runs built-in Kubernetes analyzers (Pods, Services, Deployments, Ingress, PVCs) to surface cluster failures cleanly in JSON (--output=json), with optional --explain LLM remediation and --anonymize secret scrubbing.
brew install k8sgpt Coding agents already have an LLM, so running k8sgpt analyze --output=json without --explain gives zero-LLM-cost deterministic Kubernetes diagnostics.
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
Clean --output=json, --filter, --namespace, and --explain toggle allow agents to run pure deterministic checks or AI-enriched scans.
- Supports
--output=json,--filter, and-n <namespace> - Optional
--explainand--anonymizeflags
Read-only against Kubernetes clusters, though --explain sends cluster error snippets to external LLMs unless --anonymize or a local backend is configured.
- Read-only Kubernetes API scanning
--explaintransmits cluster metadata to external LLMs unless anonymized
Single static Go binary via Homebrew and GitHub Releases on macOS, Linux, and Windows.
- Cross-platform binary via
brew install k8sgpt
Bundles curated Kubernetes failure analyzers into a single JSON command, saving agents from cross-checking Pods, Events, and Endpoints manually.
- Multi-resource diagnostic analyzers in one pass
CNCF Sandbox project (k8sgpt-ai/k8sgpt) under Apache-2.0.
- CNCF
k8sgpt-ai/k8sgptrepository
Clear docs.k8sgpt.ai reference covering analyzers, auth backends, and filters.
- Official docs at docs.k8sgpt.ai
Security, Auth & Guardrails
Reads cluster state from ~/.kube/config (KUBECONFIG) and stores LLM backend configs/keys in OS XDG config (k8sgpt.yaml) via k8sgpt auth add.
CLI is free (Apache-2.0); --explain incurs third-party LLM token charges unless using local Ollama/NoopAI.
# K8sGPT Agent Rules - Omit `--explain` when the coding agent itself will interpret `k8sgpt analyze --output=json` findings (faster and avoids duplicate LLM billing). - Whenever `--explain` is used with cloud LLMs, ALWAYS pass `--anonymize`. - Pass `--backend`, `--model`, and `--password` explicitly on `k8sgpt auth add` to avoid interactive prompts.
Agent-Ready Command Recipes
Safe Read-Only Queries
k8sgpt analyze -n default --filter=Pod,Service --output=json
Runs K8sGPT's built-in Go analyzers locally against the cluster and outputs structured JSON findings without calling an external LLM.
k8sgpt analyze -n default --explain --anonymize --output=json
Obfuscates sensitive names/values before requesting LLM explanations and returns structured JSON.
Strengths for Agents
- +
k8sgpt analyze --output=jsonworks without an LLM key when--explainis omitted. - + Built-in
--anonymizescrubs sensitive identifiers before sending data to external LLM backends. - + Supports
--filterand--namespaceto keep JSON diagnostic output focused.
Caveats & Pitfalls
- !
k8sgpt auth addprompts interactively if--backend/--passwordflags are omitted. - ! Enabling
--explainwith cloud AI providers incurs external token costs and data egress risk without--anonymize.