SkillAgentSearch skills...

K8sgpt

Giving Kubernetes Superpowers to everyone

Install / Use

/learn @k8sgpt-ai/K8sgpt
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<picture> <source media="(prefers-color-scheme: dark)" srcset="./images/banner-white.png" width="600px;"> <img alt="Text changing depending on mode. Light: 'So light!' Dark: 'So dark!'" src="./images/banner-black.png" width="600px;"> </picture> <br/>

GitHub code size in bytes GitHub Workflow Status GitHub release (latest by date) OpenSSF Best Practices Link to documentation FOSSA Status License Go version codecov GitHub last commit (branch)

k8sgpt is a tool for scanning your Kubernetes clusters, diagnosing, and triaging issues in simple English.

It has SRE experience codified into its analyzers and helps to pull out the most relevant information to enrich it with AI.

Out of the box integration with OpenAI, Azure, Cohere, Amazon Bedrock, Google Gemini and local models.

Sister project: Check out sympozium for managing agents in Kubernetes.

<a href="https://www.producthunt.com/posts/k8sgpt?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-k8sgpt" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=389489&theme=light" alt="K8sGPT - K8sGPT&#0032;gives&#0032;Kubernetes&#0032;Superpowers&#0032;to&#0032;everyone | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a> <a href="https://hellogithub.com/repository/9dfe44c18dfb4d6fa0181baf8b2cf2e1" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=9dfe44c18dfb4d6fa0181baf8b2cf2e1&claim_uid=gqG4wmzkMrP0eFy" alt="Featured|HelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>

<img src="images/demo4.gif" width="650px">

Table of Contents

CLI Installation

Linux/Mac via brew

brew install k8sgpt

or

brew tap k8sgpt-ai/k8sgpt
brew install k8sgpt
<details> <summary>RPM-based installation (RedHat/CentOS/Fedora)</summary>

32 bit:

<!---x-release-please-start-version-->
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.31/k8sgpt_386.rpm
<!---x-release-please-end-->

64 bit:

<!---x-release-please-start-version-->
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.31/k8sgpt_amd64.rpm
<!---x-release-please-end--> </details> <details> <summary>DEB-based installation (Ubuntu/Debian)</summary>

32 bit:

<!---x-release-please-start-version-->
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.31/k8sgpt_386.deb
sudo dpkg -i k8sgpt_386.deb
<!---x-release-please-end-->

64 bit:

<!---x-release-please-start-version-->
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.31/k8sgpt_amd64.deb
sudo dpkg -i k8sgpt_amd64.deb
<!---x-release-please-end--> </details> <details> <summary>APK-based installation (Alpine)</summary>

32 bit:

<!---x-release-please-start-version-->
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.31/k8sgpt_386.apk
apk add --allow-untrusted k8sgpt_386.apk
<!---x-release-please-end-->

64 bit:

<!---x-release-please-start-version-->
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.31/k8sgpt_amd64.apk
apk add --allow-untrusted k8sgpt_amd64.apk
<!---x-release-please-end--> </details> <details> <summary>Failing Installation on WSL or Linux (missing gcc)</summary> When installing Homebrew on WSL or Linux, you may encounter the following error:
==> Installing k8sgpt from k8sgpt-ai/k8sgpt Error: The following formula cannot be installed from a bottle and must be
built from the source. k8sgpt Install Clang or run brew install gcc.

If you install gcc as suggested, the problem will persist. Therefore, you need to install the build-essential package.

   sudo apt-get update
   sudo apt-get install build-essential
</details>

Windows

  • Download the latest Windows binaries of k8sgpt from the Release tab based on your system architecture.
  • Extract the downloaded package to your desired location. Configure the system PATH environment variable with the binary location

Operator Installation

To install within a Kubernetes cluster please use our k8sgpt-operator with installation instructions available here

This mode of operation is ideal for continuous monitoring of your cluster and can integrate with your existing monitoring such as Prometheus and Alertmanager.

Quick Start

  • Currently, the default AI provider is OpenAI, you will need to generate an API key from OpenAI
    • You can do this by running k8sgpt generate to open a browser link to generate it
  • Run k8sgpt auth add to set it in k8sgpt.
    • You can provide the password directly using the --password flag.
  • Run k8sgpt filters to manage the active filters used by the analyzer. By default, all filters are executed during analysis.
  • Run k8sgpt analyze to run a scan.
  • And use k8sgpt analyze --explain to get a more detailed explanation of the issues.
  • You also run k8sgpt analyze --with-doc (with or without the explain flag) to get the official documentation from Kubernetes.

Using with Claude Desktop

K8sGPT can be integrated with Claude Desktop to provide AI-powered Kubernetes cluster analysis. This integration requires K8sGPT v0.4.14 or later.

Prerequisites

  1. Install K8sGPT v0.4.14 or later:

    brew install k8sgpt
    
  2. Install Claude Desktop from the official website

  3. Configure K8sGPT with your preferred AI backend:

    k8sgpt auth
    

Setup

  1. Start the K8sGPT MCP server:

    k8sgpt serve --mcp
    
  2. In Claude Desktop:

    • Open Settings
    • Navigate to the Integrations section
    • Add K8sGPT as a new integration
    • The MCP server will be automatically detected
  3. Configure Claude Desktop with the following JSON:

{
  "mcpServers": {
    "k8sgpt": {
      "command": "k8sgpt",
      "args": [
        "serve",
        "--mcp"
      ]
    }
  }
}

Usage

Once connected, you can use Claude Desktop to:

  • Analyze your Kubernetes cluster
  • Get detailed insights about cluster health
  • Receive recommendations for fixing issues
  • Query cluster information

Example commands in Claude Desktop:

  • "Analyze my Kubernetes cluster"
  • "What's the health status of my cluster?"
  • "Show me any issues in the default namespace"

Troubleshooting

If you encounter connection issues:

  1. Ensure K8sGPT is running with the MCP server enabled
  2. Verify your Kubernetes cluster is accessible
  3. Check that your AI backend is properly configured
  4. Restart both K8sGPT and Claude Desktop

For more information, visit our documentation.

Analyzers

K8sGPT uses analyzers to triage and diagnose issues in your cluster. It has a set of analyzers that are built in, but you will be able to write your own analyzers.

Built in analyzers

Enabled by default

  • [x] podAnalyzer
  • [x] pvcAnalyzer
  • [x] rsAnalyzer
  • [x] serviceAnalyzer
  • [x] eventAnalyzer
  • [x] ingressAnalyzer
  • [x] statefulSetAnalyzer
  • [x] deploymentAnalyzer
  • [x] jobAnalyzer
  • [x] cronJobAnalyzer
  • [x] nodeAnalyzer
  • [x] mutatingWebhookAnalyzer
  • [x] validatingWebhookAnalyzer
  • [x] configMapAnalyzer

Optional

  • [x] hpaAnalyzer
  • [x] pdbAnalyzer
  • [x] networkPolicyAnalyzer
  • [x] gatewayClass
  • [x] gateway
  • [x] httproute
  • [x] logAnalyzer
  • [x] storageAnalyzer
  • [x] securityAnalyzer
  • [x] CatalogSource
  • [x] ClusterCatalog
  • [x] ClusterExtension
  • [x] ClusterService
  • [x] ClusterServiceVersion
  • [x] OperatorGroup
  • [x] InstallPlan
  • [x] Subscription

Examples

Run a scan with the default analyzers

k8sgpt generate
k8sgpt auth add
k8sgpt analyze --explain
k8sgpt analyze --explain --with-doc

Filter on resource

k8sgpt analyze --explain --filter=Service

Filter by namespace

k8sgpt analyze --explain --filter=Pod --namespace=default

Output to JSON

k8sgpt analyze --explain --filter=Service --output=json

Anonymize during explain

k8sgpt analyze --explain --filter=Service --output=json --anonymize
<details> <summary> Using filters </summary>

List filters

k8sgpt filters list

Add default filters

k8sgpt filters add [filter(s)]

Examples :

  • Simple filter : k8sgpt filters add Service
  • Multiple filters : `k8sgpt fil
View on GitHub
GitHub Stars7.6k
CategoryDevelopment
Updated4h ago
Forks965

Languages

Go

Security Score

100/100

Audited on Mar 29, 2026

No findings