K8sGPT
K8sGPT is an Artificial Intelligence (AI)-assisted tool designed to supercharge Site Reliability Engineering (SRE) tasks within Kubernetes ...
Last verified:
What is K8sGPT?
K8sGPT is an AI-powered diagnostics and troubleshooting tool for Kubernetes clusters that uses large language models to analyze cluster state, identify issues, and provide actionable remediation suggestions. It acts as an AI-powered Site Reliability Engineer (SRE), continuously scanning Kubernetes resources like pods, deployments, services, nodes, and events to triage problems in simple English. The tool has SRE experience codified into its built-in analyzers and pulls out the most relevant information to enrich analysis with AI explanations.
Key features include AI-powered analysis with advanced algorithms that provide intelligent troubleshooting insights, automatic data anonymization that masks sensitive data before sending to external AI backends, support for multiple AI providers (OpenAI, Azure OpenAI, Google Vertex AI, Amazon Bedrock, IBM WatsonX, Ollama, Cohere, Hugging Face, and local AI models), and auto-remediation that can automatically apply suggested fixes to common Kubernetes issues. It offers fine-grained control with toggleable auto-remediation, AI-free local analysis mode, selective analyzer selection, and custom analyzer support for organization-specific diagnostics.
K8sGPT is designed for Kubernetes users of all expertise levels including DevOps engineers, Site Reliability Engineers, developers, and cloud administrators who need to manage and troubleshoot Kubernetes clusters. It integrates seamlessly as both a CLI tool for local use and as a Kubernetes operator for continuous cluster monitoring. The tool also supports Model Context Protocol (MCP) integration for use with AI assistants like Claude Desktop, enabling native CLI experience and enhanced AI capabilities for Kubernetes management.
K8sGPT pricing
Pricing model: Free
K8sGPT is free and open-source under Apache 2.0 license with no subscription fees. The only direct cost is the LLM token fees for the AI provider you choose (OpenAI, Azure OpenAI, Cohere, Amazon Bedrock, Google Gemini, or self-hosted models). Local AI models like Ollama can be used completely free with no token costs. The CLI tool and Kubernetes operator are both free to use. There is no paid tier from K8sGPT itself - users only pay for their chosen AI provider's token consumption.
K8sGPT pros
- AI-powered Kubernetes issue diagnosis and troubleshooting
- Automated remediation with toggleable auto-fix capability
- Automatic data anonymization before sending to AI backends
- Support for 10+ AI providers including OpenAI, Azure, Google, Amazon
- Local AI model support (Ollama, Local AI) for data privacy
- 30+ built-in analyzers covering pods, deployments, services, nodes
- Custom analyzer support for organization-specific diagnostics
- CLI and Kubernetes operator installation options
- AI-free analysis mode for simple local diagnostics
- Fine-grained control over which analyzers to run
- Cluster analysis with AI-powered explanations
- Pod logs and cluster events access for troubleshooting
- Resource management with detailed Kubernetes resource inspection
- Analyzer control to enable/disable specific analyzers
- MCP protocol support for Claude Desktop and AI assistant integration
- JSON and YAML output format options
- Namespace-specific analysis capability
- Filter support for targeting specific resource types
- Remote caching with AWS S3, Azure Blob, and Google Cloud Storage
- Open-source under Apache 2.0 license
K8sGPT cons
- Dependency on external AI model quality for accuracy
- Slight performance overhead on Kubernetes cluster
- Events analyzer does not currently mask sensitive data
- Config file stores API keys in plain text
- Only diagnoses Kubernetes, not full infrastructure
- No automatic problem fixing by default (recommendation-only)
- Requires AI backend authentication for explain feature
- Limited to Kubernetes resource errors, not application logic
- Custom analyzers require additional setup and configuration
- Remote caching requires proper permissions and credentials
Frequently asked questions about K8sGPT
What is K8sGPT?
K8sGPT is an AI-powered tool that helps diagnose and fix Kubernetes issues with intelligent insights and automated troubleshooting. It scans your Kubernetes clusters, diagnoses and triages issues in simple English, and has SRE experience codified into its analyzers to help pull out the most relevant information and enrich it with AI.
How do I install K8sGPT?
K8sGPT can be installed via multiple methods: Homebrew (brew install k8sgpt), curl (curl -sSfL https://raw.githubusercontent.com/k8sgpt-ai/k8sgpt/main/install.sh | sh), wget, RPM for RedHat/CentOS/Fedora, DEB for Ubuntu/Debian, APK for Alpine, or Windows binaries from the Release tab. For Kubernetes-native installation, use the k8sgpt-operator for continuous cluster monitoring.
Which AI providers does K8sGPT support?
K8sGPT supports OpenAI, Azure OpenAI, Google Vertex AI, Amazon Bedrock, IBM WatsonX, Local AI, Ollama, Cohere, and Hugging Face. The default provider is OpenAI, but you can configure any provider using the k8sgpt auth add command with the --backend flag.
How do I authenticate with an AI backend?
First generate a token by running k8sgpt generate which opens a browser link. Then authenticate using k8sgpt auth add --backend openai --model gpt-4o-mini and paste your token. You can list configured backends with k8sgpt auth list and set a default provider with k8sgpt auth default -p azureopenai.
How do I analyze my Kubernetes cluster?
Run k8sgpt analyze to scan for problems. For detailed AI explanations, use k8sgpt analyze --explain. You can filter by resource type with --filter=Service, specify namespace with --namespace=default, output as JSON with --output=json, and get official Kubernetes documentation with --with-doc.
What analyzers are available in K8sGPT?
Built-in analyzers enabled by default include podAnalyzer, pvcAnalyzer, rsAnalyzer, serviceAnalyzer, eventAnalyzer, ingressAnalyzer, statefulSetAnalyzer, deploymentAnalyzer, jobAnalyzer, cronJobAnalyzer, nodeAnalyzer, mutatingWebhookAnalyzer, validatingWebhookAnalyzer, and configMapAnalyzer. Optional analyzers include hpaAnalyzer, pdbAnalyzer, networkPolicyAnalyzer, gatewayClass, gateway, httproute, logAnalyzer, storageAnalyzer, and securityAnalyzer.
Does K8sGPT automatically fix Kubernetes issues?
K8sGPT has auto-remediation capability that can automatically apply suggested fixes to common Kubernetes issues, but this is toggleable - you decide if K8sGPT should automatically apply fixes. The main goal is to offer recommendations and insights to help address issues, not to automatically fix problems by default.
How does data anonymization work?
Sensitive data like Kubernetes object names and labels are automatically masked before being sent to external AI backends. The data is replaced by a key that can de-anonymize when the solution returns. However, anonymization does not currently apply to events, and certain fields like Describe, ObjectStatus, Replicas, ContainerStatus, Event Message, ReplicaStatus, and Count are not masked.
Can I use K8sGPT without AI?
Yes, K8sGPT offers AI-Free Analysis mode where you can run built-in analyzers locally without involving any AI backend for simple diagnostics. This keeps data entirely within your environment and is recommended for critical production environments.
How do I integrate K8sGPT with Claude Desktop?
Install K8sGPT v0.4.14 or later, then start the MCP server with k8sgpt serve --mcp. In Claude Desktop, open Settings, navigate to Integrations, add K8sGPT as a new integration. Configure with JSON specifying the command as k8sgpt and args as serve --mcp. This enables cluster analysis, health insights, issue recommendations, and cluster information queries.