k8sgpt

k8sgpt-aiApache-2.0活跃维护

用大模型扫描 Kubernetes 集群并诊断故障,把晦涩的报错和事件翻译成人能看懂的解释和修复建议。

Giving Kubernetes Superpowers to everyone

v0.4.41发布于 2026-10-21 09:51 UTC8,318star +10 / 7 天1,096fork同步于 2026-11-11 05:29 UTC

怎么上手

由 README 提炼,执行前请确认
brew install k8sgpt
k8sgpt generate
k8sgpt auth add
k8sgpt analyze --explain
硬件要求按 README 说明

README 未说明具体硬件要求;本地模型后端需自行准备运行环境,其余后端为云端 API。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用内置分析器扫描 K8s 集群并用 AI 以通俗英文诊断问题

用大模型扫描 Kubernetes 集群并诊断故障,把晦涩的报错和事件翻译成人能看懂的解释和修复建议。

核心能力

  • 内置 pod、pvc、service、node 等分析器自动排查集群问题
  • 支持 OpenAI、Azure、Cohere、Bedrock、Gemini 及本地模型后端
  • 可用 --filter 和 --namespace 限定分析范围并输出 JSON
  • 提供 --anonymize 在解释前对敏感信息脱敏
  • 支持 serve 模式与 MCP 协议接入 Claude Desktop

容易踩的坑

默认 AI 后端是 OpenAI,需先获取 API key 并用 auth add 配置;WSL 或 Linux 上通过 brew 安装可能因缺少 gcc 失败,需先装 build-essential;MCP 服务默认占用 8089 端口,serve 模式默认 8080。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.4.41
  1. v0.4.41最新正式版2026-10-21 · 2026-10-21 09:51 UTC

    0.4.41 (2026-10-20)

    Features

    • add Claude 4.5 and 5.x models for Amazon Bedrock (#1819) (a49636c)
    • enable to source customHeaders from the config file (#1339) (37b87f1)
    • prompt to auto-pull missing ollama models (#1766) (e977dc5)

    Bug Fixes

    • accept an empty storageClassName in StatefulSet claim templates (#1830) (642c3a4)
    • do not report an unsupported KEDA scaleTargetRef as missing (#1831) (7fd1b40)
    • harden completion calls against empty responses and hangs (#1731) (dca17b9)
    • honor matchExpressions in NetworkPolicy pod selectors (#1818) (e8a8a1d)
    • honor the namespace filter in the Gateway API analyzers (#1826) (33935bf)
    • keep the known parent when the top owner has an unsupported kind (#1833) (bf4432b)
    • keep webhook findings when configurations share a webhook name (#1827) (912a7cb)
    • match HTTPRoute namespace selectors against the namespace (#1825) (9a8398e)
    • recognize node-problem-detector node conditions (#1821) (7a22730)
    • report failed results in Kyverno ClusterPolicyReports (#1832) (70fdcdc)

    Other

    • deps: update goreleaser/goreleaser-action digest to a4f02ab (#1829) (d9a9352)
    • deps: update module github.com/containerd/containerd to v1.7.36 [security] (#1834) (bd42af7)
    • deps: update module github.com/moby/spdystream to v0.5.1 [security] (#1835) (4c58db4)
    • deps: update module go.opentelemetry.io/otel/sdk to v1.45.0 [security] (#1836) (67b7f13)

    Refactoring

  2. v0.4.402026-10-09 · 2026-10-09 19:46 UTC
    查看更新说明

    0.4.40 (2026-10-09)

    Features

    • add ResourceClaim analyzer for missing DeviceClasses (#1768) (f2dd92e)

    Bug Fixes

    • close the custom analyzer gRPC connection after each analysis (#1800) (d6d75f7)
    • correct API doc lookups for the webhook analyzers (#1802) (ce78560)
    • handle empty AI responses and respect configured language (#1756) (9456068)
    • honor StatefulSet start ordinals (#1759) (dd16466)
    • honour K8SGPT_BACKEND on every serve start (#1749) (6959a93)
    • ignore in-progress Deployment replica mismatches (#1743) (cbaae54)
    • paginate S3 object listings (#1811) (21aadb4)
    • recognize EKS node monitoring agent node conditions (#1798) (635d9b1), closes #1461
    • register kyverno policy-report scheme once to avoid concurrent map writes (#1777) (2556f80)
    • render PDB selector operators as readable phrases (#1820) (1bd139d)
    • report blocked PDBs whose selector is empty or uses matchExpressions (#1797) (2a129c5)
    • report DeadlineExceeded and JobFailed conditions in Job analyzer (#1809) (7b26cd1)
    • report FailedBinding events in PersistentVolumeClaim analyzer (#1808) (9ca8484)
    • report missing default backend services in Ingress analyzer (#1810) (79fdc97)
    • scope analyzer events to object identity (#1790) (09c5098)
    • scope ConfigMap usage tracking to pod namespace (#1812) (c422c96)
    • scope NetworkPolicy pod lookup to policy namespace (#1747) (432ebaa)
    • scope service events
  3. v0.4.392026-09-14 · 2026-09-14 13:57 UTC
    查看更新说明

    0.4.39 (2026-09-14)

    Features

    • add --resource flag to analyze a single resource (#1761) (6863057)
    • add ValidatingAdmissionPolicy analyzer (#1765) (c520d4a)

    Bug Fixes

    • anonymise resource names in event-derived failures (#1778) (1813838)
    • deps: update module google.golang.org/grpc to v1.83.1 [security] (#1772) (e69dbc7)
    • deps: update module google.golang.org/grpc to v1.83.2 [security] (#1780) (9c515b0)
    • do not also report an unsupported scaleTargetRef as missing (#1729) (48737a8)
    • filter service events by involved object kind (#1783) (7b91b07)
    • guard against empty completion choices in OpenAIClient (#1781) (ddcc509)
    • report ReplicaFailure regardless of replica count (#1750) (40970ea)
    • resolve ClusterRole references in RoleBindings (#1755) (4c31811)

    Other

    • deps: update actions/checkout action to v7 (#1661) (0d32bac)
    • deps: update golang docker tag to v1.27 (#1745) (731a6c9)
  4. v0.4.382026-09-01 · 2026-09-01 10:34 UTC
    查看更新说明

    0.4.38 (2026-09-01)

    Bug Fixes

    • correct --with-stat flag description (#1734) (ebd79ac)
    • validate namespace exists before running core analyzers (#1735) (c7e91c0)

    Other

    • deps: update docker/setup-buildx-action digest to 37fe631 (#1744) (92c0091)
    • deps: update softprops/action-gh-release digest to efb3536 (#1763) (7e4e955)
  5. v0.4.372026-08-27 · 2026-08-27 06:31 UTC
    查看更新说明

    0.4.37 (2026-08-19)

    Features

    Bug Fixes

    • clamp max-concurrency in custom analysis to avoid deadlock and panic (#1700) (6859e9c)
    • deps: update k8s.io/utils digest to cf1189d (#1688) (8bda53b)
    • deps: update module google.golang.org/grpc to v1.82.1 [security] (#1714) (1c8a56c)
    • do not panic on an Ingress path with a resource backend (#1728) (b4a86de)
    • guard against nil backend port in HTTPRoute analyzer (#1702) (447f30e)
    • guard against nil spec.replicas in deployment analyzer (#1683) (58ab921)
    • guard empty API key in Google GenAI client (#1699) (6efe5b5)
    • ignore HPA ScalingLimited TooFewReplicas at minReplicas (#1716) (63f0663)
    • inspect Gateway Accepted and Programmed by type (#1737) (3936f70)
    • mask real pod name and namespace in statefulset analyzer (#1703) (4e7531b)
    • point release-please extra-files at the real chart path (#1697) (133dbe6)
    • populate ParentObject in ClusterCatalog and ClusterExtension analyzers (#1707) (1b4ef99)
    • prevent nil prometheus config dereference on invalid gzipped config (#1708) (5347c41)
    • report Deployment ProgressDeadlineExceeded when replica counts still match (#1740) (05247a8)
    • report keda scaledobject failures when no event exists (#1706) (c8ae792)
    • resolve EKS default kubeconfig path across platforms (#1686) (f247b3f)
    • scan init containers fo

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    GitHub code size in bytes GitHub Workflow Status GitHub release (latest by date) OpenSSF Best Practices OpenSSF Scorecard Artifact Hub Link to documentation 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.

    Table of Contents

    CLI Installation

    Linux/Mac via brew

    brew install k8sgpt
    

    or

    brew tap k8sgpt-ai/k8sgpt
    brew install k8sgpt
    

    32 bit:

    sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.41/k8sgpt_386.rpm
    

    64 bit:

    sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.41/k8sgpt_amd64.rpm
    

    32 bit:

    curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.41/k8sgpt_386.deb
    sudo dpkg -i k8sgpt_386.deb
    

    64 bit:

    curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.41/k8sgpt_amd64.deb
    sudo dpkg -i k8sgpt_amd64.deb
    

    32 bit:

    wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.41/k8sgpt_386.apk
    apk add --allow-untrusted k8sgpt_386.apk
    

    64 bit:

    wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.41/k8sgpt_amd64.apk
    apk add --allow-untrusted k8sgpt_amd64.apk
    
    ==> 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
    

    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
    • podAnalyzer
    • pvcAnalyzer
    • rsAnalyzer
    • serviceAnalyzer
    • eventAnalyzer
    • ingressAnalyzer
    • statefulSetAnalyzer
    • deploymentAnalyzer
    • jobAnalyzer
    • cronJobAnalyzer
    • nodeAnalyzer
    • mutatingWebhookAnalyzer
    • validatingWebhookAnalyzer
    • configMapAnalyzer
    Optional
    • hpaAnalyzer
    • pdbAnalyzer
    • networkPolicyAnalyzer
    • gatewayClass
    • gateway
    • httproute
    • logAnalyzer
    • storageAnalyzer
    • securityAnalyzer
    • CatalogSource
    • ClusterCatalog
    • ClusterExtension
    • ClusterService
    • ClusterServiceVersion
    • OperatorGroup
    • InstallPlan
    • Subscription
    • ValidatingAdmissionPolicy
    • ResourceClaim
    • NodeClaim (Karpenter v1; cluster-scoped, so --namespace does not apply)
    • NodePool (Karpenter v1; cluster-scoped, so --namespace does not apply; pools at their limit are reported as at capacity)

    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
    

    List filters

    k8sgpt filters list
    

    Add default filters

    k8sgpt filters add [filter(s)]
    

    Examples :

    • Simple filter : k8sgpt filters add Service
    • Multiple filters : k8sgpt filters add Ingress,Pod

    Remove default filters

    k8sgpt filters remove [filter(s)]
    

    Examples :

    • Simple filter : k8sgpt filters remove Service
    • Multiple filters : k8sgpt filters remove Ingress,Pod

    List configured backends

    k8sgpt auth list
    

    Update configured backends

    k8sgpt auth update $MY_BACKEND1,$MY_BACKEND2..
    

    Remove configured backends

    k8sgpt auth remove -b $MY_BACKEND1,$MY_BACKEND2..
    

    List integrations

    k8sgpt integrations list
    

    Activate integrations

    k8sgpt integrations activate [integration(s)]
    

    Use integration

    k8sgpt analyze --filter=[integration(s)]
    

    Deactivate integrations

    k8sgpt integrations deactivate [integration(s)]
    

    Serve mode

    k8sgpt serve
    

    Serve mode with MCP (Model Context Protocol)

    # Enable MCP server on default port 8089
    k8sgpt serve --mcp --mcp-http
    
    # Enable MCP server on custom port
    k8sgpt serve --mcp --mcp-http --mcp-port 8089
    
    # Full serve mode with MCP
    k8sgpt serve --mcp --mcp-http --port 8080 --metrics-port 8081 --mcp-port 8089
    

    The MCP server enables integration with tools like Claude Desktop and other MCP-compatible clients. It runs on port 8089 by default and provides:

    • Kubernetes cluster analysis via MCP protocol
    • Resource information and health status
    • AI-powered issue explanations and recommendations

    For Helm chart deployment with MCP support, see the charts/k8sgpt/values-mcp-example.yaml file.

    Analysis with serve mode

    grpcurl -plaintext -d '{"namespace": "k8sgpt", "explain" : "true"}' localhost:8080 schema.v1.ServerAnalyzerService/Analyze
    {
      "status": "OK"
    }
    

    Analysis with custom headers

    k8sgpt analyze --explain --custom-headers CustomHeaderKey:CustomHeaderValue
    

    Print analysis stats

    k8sgpt analyze -s
    The stats mode allows for debugging and understanding the time taken by an analysis by displaying the statistics of each analyzer.
    - Analyzer Ingress took 47.125583ms
    - Analyzer PersistentVolumeClaim took 53.009167ms
    - Analyzer CronJob took 57.517792ms
    - Analyzer Deployment took 156.6205ms
    - Analyzer Node took 160.109833ms
    - Analyzer ReplicaSet took 245.938333ms
    - Analyzer StatefulSet took 448.0455ms
    - Analyzer Pod took 5.662594708s
    - Analyzer Service took 38.583359166s
    

    Diagnostic information

    To collect diagnostic information use the following command to create a dump_<timestamp>_json in your local directory.

    k8sgpt dump
    

    LLM AI Backends

    K8sGPT uses the chosen LLM, generative AI provider when you want to explain the analysis results using --explain flag e.g. k8sgpt analyze --explain. You can use --backend flag to specify a configured provider (it's openai by default).

    You can list available providers using k8sgpt auth list:

    Default:
    > openai
    Active:
    Unused:
    > openai
    > localai
    > ollama
    > azureopenai
    > cohere
    > amazonbedrock
    > amazonsagemaker
    > google
    > huggingface
    > noopai
    > googlevertexai
    > watsonxai
    > customrest
    > ibmwatsonxai
    > litellm
    > gpt2giga
    

    For detailed documentation on how to configure and use each provider see here. The AI backend support tiers page explains which backends are Core and which are Community-maintained.

    Using LiteLLM (route to 100+ providers through one proxy)

    The litellm backend talks to a LiteLLM proxy, which exposes an OpenAI-compatible API in front of 100+ providers (OpenAI, Azure, Anthropic, Bedrock, Gemini, ...). It defaults to the proxy's standard local endpoint (http://localhost:4000/v1); use --model to pick a model configured in your proxy, and --baseurl to point at a remote proxy. A password is only needed if your proxy enforces a virtual key.

    k8sgpt auth add --backend litellm --model gpt-4o
    k8sgpt analyze --explain --backend litellm
    

    Using GPT2Giga

    The gpt2giga backend connects to a GPT2Giga service using the OpenAI-compatible Chat Completions API. It defaults to http://localhost:8090; use --baseurl to configure a different endpoint. This backend does not require a password.

    k8sgpt auth add --backend gpt2giga --model <model>
    k8sgpt analyze --explain --backend gpt2giga
    

    To set a new default provider

    k8sgpt auth default -p azureopenai
    Default provider set to azureopenai
    

    Using Amazon Bedrock Converse with inference profiles

    System Inference Profile

    k8sgpt auth add --backend amazonbedrockconverse --providerRegion us-east-1 --model arn:aws:bedrock:us-east-1:123456789012:inference-profile/my-inference-profile
    
    

    Application Inference Profile

    k8sgpt auth add --backend amazonbedrockconverse --providerRegion us-east-1 --model arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/2uzp4s0w39t6
    
    

    Using Amazon Bedrock with inference profiles

    System Inference Profile

    k8sgpt auth add --backend amazonbedrock --providerRegion us-east-1 --model arn:aws:bedrock:us-east-1:123456789012:inference-profile/my-inference-profile
    
    

    Application Inference Profile

    k8sgpt auth add --backend amazonbedrock --providerRegion us-east-1 --model arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/2uzp4s0w39t6
    
    

    Key Features

    With this option, the data is anonymized before being sent to the AI Backend. During the analysis execution, k8sgpt retrieves sensitive data (Kubernetes object names, labels, etc.). This data is masked when sent to the AI backend and replaced by a key that can be used to de-anonymize the data when the solution is returned to the user.

    1. Error reported during analysis:
    Error: HorizontalPodAutoscaler uses StatefulSet/fake-deployment as ScaleTargetRef which does not exist.
    
    1. Payload sent to the AI backend:
    Error: HorizontalPodAutoscaler uses StatefulSet/tGLcCRcHa1Ce5Rs as ScaleTargetRef which does not exist.
    
    1. Payload returned by the AI:
    The Kubernetes system is trying to scale a StatefulSet named tGLcCRcHa1Ce5Rs using the HorizontalPodAutoscaler, but it cannot find the StatefulSet. The solution is to verify that the StatefulSet name is spelled correctly and exists in the same namespace as the HorizontalPodAutoscaler.
    
    1. Payload returned to the user:
    The Kubernetes system is trying to scale a StatefulSet named fake-deployment using the HorizontalPodAutoscaler, but it cannot find the StatefulSet. The solution is to verify that the StatefulSet name is spelled correctly and exists in the same namespace as the HorizontalPodAutoscaler.
    

    Further Details

    Note: Anonymization does not currently apply to events.

    In a few analysers like Pod, we feed to the AI backend the event messages which are not known beforehand thus we are not masking them for the time being.

    • The following is the list of analysers in which data is being masked:-

      • Statefulset
      • Service
      • PodDisruptionBudget
      • Node
      • NetworkPolicy
      • Ingress
      • HPA
      • Deployment
      • Cronjob
    • The following is the list of analysers in which data is not being masked:-

      • ReplicaSet
      • PersistentVolumeClaim
      • Pod
      • Log
      • *Events

    *Note:

    • k8gpt will not mask the above analysers because they do not send any identifying information except Events analyser.

    • Masking for Events analyzer is scheduled in the near future as seen in this issue. Further research has to be made to understand the patterns and be able to mask the sensitive parts of an event like pod name, namespace etc.

    • The following is the list of fields which are not being masked:-

      • Describe
      • ObjectStatus
      • Replicas
      • ContainerStatus
      • *Event Message
      • ReplicaStatus
      • Count (Pod)

    *Note:

    • It is quite possible the payload of the event message might have something like "super-secret-project-pod-X crashed" which we don't currently redact (scheduled in the near future as seen in this issue).

    Proceed with care

    • The K8gpt team recommends using an entirely different backend (a local model) in critical production environments. By using a local model, you can rest assured that everything stays within your DMZ, and nothing is leaked.
    • If there is any uncertainty about the possibility of sending data to a public LLM (open AI, Azure AI) and it poses a risk to business-critical operations, then, in such cases, the use of public LLM should be avoided based on personal assessment and the jurisdiction of risks involved.

    k8sgpt stores config data in the $XDG_CONFIG_HOME/k8sgpt/k8sgpt.yaml file. The data is stored in plain text, including your OpenAI key.

    Config file locations:

    OSPath
    MacOS~/Library/Application Support/k8sgpt/k8sgpt.yaml
    Linux~/.config/k8sgpt/k8sgpt.yaml
    Windows%LOCALAPPDATA%/k8sgpt/k8sgpt.yaml

    Adding a remote cache

    • AWS S3
      • As a prerequisite AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are required as environmental variables.
      • Configuration, k8sgpt cache add s3 --region <aws region> --bucket <name>
      • Minio Configuration with HTTP endpoint k8sgpt cache add s3 --bucket <name> --endpoint <http://localhost:9000>
      • Minio Configuration with HTTPs endpoint, skipping TLS verification k8sgpt cache add s3 --bucket <name> --endpoint <https://localhost:9000> --insecure
        • K8sGPT will create the bucket if it does not exist
    • Azure Storage
      • We support a number of techniques to authenticate against Azure
      • Configuration, k8sgpt cache add azure --storageacc <storage account name> --container <container name>
        • K8sGPT assumes that the storage account already exist and it will create the container if it does not exist
        • It is the user responsibility have to grant specific permissions to their identity in order to be able to upload blob files and create SA containers (e.g Storage Blob Data Contributor)
    • Google Cloud Storage
      • As a prerequisite GOOGLE_APPLICATION_CREDENTIALS are required as environmental variables.
      • Configuration, k8sgpt cache add gcs --region <gcp region> --bucket <name> --projectid <project id>
        • K8sGPT will create the bucket if it does not exist

    Listing cache items

    k8sgpt cache list
    

    Purging an object from the cache Note: purging an object using this command will delete upstream files, so it requires appropriate permissions.

    k8sgpt cache purge $OBJECT_NAME
    

    Removing the remote cache Note: this will not delete the upstream S3 bucket or Azure storage container

    k8sgpt cache remove
    

    There may be scenarios where you wish to write your own analyzer in a language of your choice. K8sGPT now supports the ability to do so by abiding by the schema and serving the analyzer for consumption. To do so, define the analyzer within the K8sGPT configuration and it will add it into the scanning process. In addition to this you will need to enable the following flag on analysis:

    k8sgpt analyze --custom-analysis
    

    Here is an example local host analyzer in Rust When this is run on localhost:8080 the K8sGPT config can pick it up with the following additions:

    custom_analyzers:
      - name: host-analyzer
        connection:
          url: localhost
          port: 8080
    

    This now gives the ability to pass through hostOS information ( from this analyzer example ) to K8sGPT to use as context with normal analysis.

    See the docs on how to write a custom analyzer

    Listing custom analyzers configured

    k8sgpt custom-analyzer list
    

    Adding custom analyzer without install

    k8sgpt custom-analyzer add --name my-custom-analyzer --port 8085
    

    Removing custom analyzer

    k8sgpt custom-analyzer remove --names "my-custom-analyzer,my-custom-analyzer-2"
    

    K8sGPT provides a Model Context Protocol server that exposes Kubernetes operations as standardized tools for AI assistants like Claude, ChatGPT, and other MCP-compatible clients.

    Start the MCP server:

    Stdio mode (for local AI assistants):

    k8sgpt serve --mcp
    

    HTTP mode (for network access):

    k8sgpt serve --mcp --mcp-http --mcp-port 8089
    

    Features:

    • 12 tools for cluster analysis, resource management, and debugging
    • 3 resources for cluster information access
    • 3 interactive troubleshooting prompts
    • Stateless HTTP mode for one-off invocations
    • Full integration with Claude Desktop and other MCP clients

    Learn more: See MCP.md for complete documentation, usage examples, and integration guides.

    Documentation

    Find our official documentation available here

    Adopters

    Using k8sgpt? See ADOPTERS.md and add your organization, or tell us on #1886.

    Contributing

    Please read our contributing guide.

    Community

    Find us in #k8sgpt on the CNCF Slack (get an invite at https://slack.cncf.io, then join #k8sgpt).

    Community meeting

    k8sgpt holds a monthly public community meeting, open to everyone, on the second Thursday, 16:00–17:00 UK time (Europe/London). The first meeting is Thursday 12 November 2026.

    Join on Google Meet: https://meet.google.com/ugf-zqjt-nwu

    Agenda items can be posted in #k8sgpt on CNCF Slack or in the K8sGPT Slack #general.

    Code of Conduct

    k8sgpt follows the CNCF Code of Conduct. See CODE_OF_CONDUCT.md for how to report a concern.