k8sgpt-ai/k8sgpt

Giving Kubernetes Superpowers to everyone

What is k8sgpt?

k8sgpt is a command‑line tool (and optional in‑cluster operator) that scans a Kubernetes cluster, finds problems, and explains them in plain English. It combines a set of built‑in analyzers that understand Kubernetes objects (pods, services, deployments, etc.) with an LLM (OpenAI, Azure, Cohere, Bedrock, Gemini, local models, etc.) to turn raw diagnostic data into human‑readable explanations and remediation suggestions.


Key capabilities

Feature What it does
Cluster scanning Walks the Kubernetes API, runs dozens of analyzers (e.g., pod, PVC, HPA, ingress) and collects status, events, and config details.
AI‑powered explanations Sends a concise, anonymized payload to a chosen LLM and receives a natural‑language description of the issue and how to fix it (k8sgpt analyze --explain).
Multiple LLM back‑ends Supports OpenAI, Azure OpenAI, Cohere, Amazon Bedrock, Google Gemini, Ollama, LiteLLM proxy, and self‑hosted models via a generic REST interface.
Anonymization Sensitive names are masked before they leave the cluster, then de‑masked in the final answer, reducing data‑leak risk.
Operator mode Deploy the k8sgpt‑operator inside a cluster for continuous monitoring and integration with Prometheus/Alertmanager.
MCP server Exposes a Model Context Protocol (MCP) HTTP/gRPC endpoint so other tools (e.g., Claude Desktop) can query analysis results programmatically.
Extensible filters & custom analyzers Users can enable/disable specific analyzers, filter by resource type or namespace, and write their own plugins.
Remote cache Optional S3 or Azure Blob storage for caching analysis results.
Easy installation Homebrew, RPM, DEB, APK packages and pre‑built binaries for Windows.

Who might use it?

  • Site Reliability Engineers (SREs) who need a quick, readable summary of cluster health without digging through logs.
  • Developers troubleshooting a failing deployment and wanting AI‑generated suggestions.
  • Platform teams that want to run continuous checks via the operator and feed results into existing monitoring stacks.
  • Anyone comfortable with the CLI who wants to experiment with LLM‑driven diagnostics for Kubernetes.

How to get started (quick‑start)

  1. Install – brew install k8sgpt (or use the RPM/DEB/Windows binary).
  2. Configure an LLM – run k8sgpt generate to open the OpenAI key page, then k8sgpt auth add (or add another backend with --backend).
  3. Run a scan – k8sgpt analyze --explain.
  4. Optional – add --with-doc to include official Kubernetes docs, or --filter=Pod --namespace=default to narrow the scope.

Where to learn more

Related

  • Project
  • Project
  • Project
  • Project
  • Project