Repolode
k8sgpt-ai

k8sgpt-ai/k8sgpt

A CLI tool that scans Kubernetes clusters for issues and uses LLMs to explain problems in plain English.

Stars
8,275
Forks
1,087
Open issues
88
Last commit
10 hours ago

What is it?

k8sgpt scans a Kubernetes cluster, runs built-in analyzers that encode common SRE checks, and reports the problems it finds. It covers resources such as Pods, Services, Deployments, Ingress, PVCs, Nodes and webhooks, and can also check optional areas like HPA, network policies, Gateway API and OLM operator objects.

For each finding, the tool can send the relevant context to an AI backend to produce a plain-language explanation and suggested fix. Supported backends include OpenAI, Azure OpenAI, Cohere, Amazon Bedrock, Google Gemini, Ollama and LiteLLM. An anonymization option masks object names before data is sent to the backend, and a `--with-doc` flag adds links to official Kubernetes documentation.

Beyond the CLI, the project offers a serve mode with gRPC and metrics endpoints, a Model Context Protocol server for clients such as Claude Desktop, and remote result caching on S3, Azure Blob or Google Cloud Storage.

Key features

  • 01Scans Kubernetes resources with built-in analyzers for Pods, Services, Deployments, Ingress, PVCs and more.
  • 02Explains detected issues in plain English using a chosen LLM backend.
  • 03Supports OpenAI, Azure, Bedrock, Gemini, Ollama and LiteLLM among other providers.
  • 04Anonymizes object names before sending data to an AI backend.
  • 05Filters results by resource type and namespace, with JSON output.
  • 06Provides a serve mode and an MCP server for integration with AI assistants.

Use cases

  • Triaging failing workloads in a cluster without manually reading through many kubectl outputs.
  • Running periodic scans of a cluster and collecting results as JSON for other tooling.
  • Giving an AI assistant like Claude Desktop access to cluster health information through MCP.
  • Running analysis against a local model when cluster data must not leave the network.

Quick start

  1. 1

    Install k8sgpt with Homebrew

    brew install k8sgpt
  2. 2

    Generate an OpenAI API key (opens a browser link)

    k8sgpt generate
  3. 3

    Add the API key to k8sgpt

    k8sgpt auth add
  4. 4

    Scan the cluster and explain the issues

    k8sgpt analyze --explain

Things to know

  • The default AI backend is OpenAI, so an OpenAI API key is needed unless you configure another provider.
  • Analysis depends on a reachable Kubernetes cluster and a configured AI backend for explanations.

In collections

Topics

FAQ

What is k8sgpt?
A CLI tool that scans Kubernetes clusters for issues and uses LLMs to explain problems in plain English. k8sgpt scans a Kubernetes cluster, runs built-in analyzers that encode common SRE checks, and reports the problems it finds. It covers resources such as Pods, Services, Deployments, Ingress, PVCs, Nodes and webhooks, and can also check optional areas like HPA, network policies, Gateway API and OLM operator objects.
Is k8sgpt free to use? What license does it have?
k8sgpt is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is k8sgpt still maintained?
Actively maintained. The last commit to k8sgpt was on Oct 24, 2026.
What can I use k8sgpt for?
Triaging failing workloads in a cluster without manually reading through many kubectl outputs. Running periodic scans of a cluster and collecting results as JSON for other tooling. Giving an AI assistant like Claude Desktop access to cluster health information through MCP. Running analysis against a local model when cluster data must not leave the network.
How do I install k8sgpt?
Install k8sgpt with Homebrew: brew install k8sgpt Generate an OpenAI API key (opens a browser link): k8sgpt generate Add the API key to k8sgpt: k8sgpt auth add Scan the cluster and explain the issues: k8sgpt analyze --explain
Where can I get k8sgpt?
The source code and installation instructions are on GitHub: https://github.com/k8sgpt-ai/k8sgpt

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects