AI — Introduction to K8sGPT — Helps diagnose and fix Kubernetes issues
AI — Introduction to K8sGPT — Helps diagnose and fix Kubernetes issues
AI — Introduction to K8sGPT — Helps diagnose and fix Kubernetes issues

Introduction
K8sGPT
K8sGPT is an AI-powered tool that helps diagnose and fix Kubernetes issues. It analyzes cluster state and provide intelligent insights for troubleshooting.
K8sGPT was accepted to CNCF on December 19, 2023 at the Sandbox maturity level.
Features:
- Data Anonymization — sensitive data is automatically anonymized before being sent to AI backends for analysis.
- Multiple AI Providers supported — support for various AI providers including OpenAI, Azure, Google, and local models. N.B: Claude Desktop Integration also available
- Auto Remediation — https://k8sgpt.ai/auto-remediation — Automatically apply suggested fixes to common Kubernetes issues, reducing manual intervention and speeding up recovery
- MCP server — https://github.com/k8sgpt-ai/k8sgpt/blob/main/MCP.md
In this article, we will try to see what K8sGPT has to offer through practical application.
Installation
K8sGPT can be installed several ways: CLI tool and Kubernetes Operator
The CLI tool is simple and flexible — run on-demand from terminals without any cluster overhead, making it perfect for troubleshooting specific issues or scanning multiple clusters quickly. However, it requires manual execution so problems won’t be catched automatically, and it’s harder to build consistent monitoring workflows.
The kubernetes operator continuously monitors cluster and proactively detects issues as they happen, storing results centrally in cluster as K8s resources (Results CRD). The downside is it consumes cluster resources and generates higher AI costs (because of continuous analysis).
Let’s talk about sandbox architecture!
Architecture

K8sGTP CLI
Installation
3 installation lines.
# Using curl
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/latest/download/k8sgpt_Linux_x86_64.tar.gz
tar -xzf k8sgpt_Linux_x86_64.tar.gz
sudo mv k8sgpt /usr/local/bin/
Run without AI
Detected issues will be displayed without help to fix them.
# Run without IA
k8sgpt analyze

Run with ollama backend
# Running with IA assistance
k8sgpt auth add --backend ollama --model llama3.2 --baseurl http://ollama.private.booleg.com
k8sgpt analyze --backend ollama --explain

Caching
Thanks to caching, when an issue happens during analysis, it will resume from where it failed.

N.B: remote caching to AWS S3, Azure storage and Google Cloud Storage is available.
You can also disable cache thanks to “--no-cache” parameter.
Interactive mode
It is also possible to run k8sgpt in interactive mode to allows further conversation with LLM about the problem.

Filtering analyzed resources
K8sGPT returns lot of “false positive” issues, more precisely issue that I consider as non critical (e.g. existing configMap but not used in any deployments).
It’s possible to limit analyze to any namespaces and resources kind.
k8sgpt analyze --backend ollama --explain --filter=Pod --namespace=default
It is also possible to filter resources analysed based on labels using “--selector” (e.g. not analyze resources with labels k8sgpt_exclude=1).
k8sgpt analyze --backend ollama --explain --selector "k8sgpt_exclude=1"
Example

K8SGPT operator
Installation
First, let’s deploy the operator.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: k8sgpt-operator
namespace: argo-cd
spec:
project: default
destination:
namespace: k8sgpt
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true
source:
repoURL: https://charts.k8sgpt.ai
chart: k8sgpt-operator
targetRevision: 0.2.25
helm:
valuesObject:
Then, let’s deploy the K8sGPT instance.
apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
name: k8sgpt
namespace: k8sgpt
spec:
ai:
enabled: true
backend: localai # Use localai backend for Ollama compatibility
baseUrl: http://ollama.llm:11434/v1
model: llama3.2 # Must match pulled model
noCache: false
version: v0.4.27
After few minutes, results resources are created.

We can retrieve issues seen in previous example.



Hope you enjoyed this introduction to K8sGPT!
Don’t forget to clap to support my work!
메타데이터
- post_id
- f061f70c9ba2
- slug
- ai-introduction-to-k8sgpt-helps-diagnose-and-fix-kubernetes-issues-f061f70c9ba2
- url
- https://blog.stackademic.com/ai-introduction-to-k8sgpt-helps-diagnose-and-fix-kubernetes-issues-f061f70c9ba2
- canonical_url
- https://blog.stackademic.com/ai-introduction-to-k8sgpt-helps-diagnose-and-fix-kubernetes-issues-f061f70c9ba2
- author_url
- https://medium.com/@genesta.sebastien
- status
- ok
- fetched_at
- 2026-07-13 06:23:13