Skip to content

Instantly share code, notes, and snippets.

@purvalpatel
Last active June 5, 2026 04:52
Show Gist options
  • Select an option

  • Save purvalpatel/f748c417b39ec23272be52f158856756 to your computer and use it in GitHub Desktop.

Select an option

Save purvalpatel/f748c417b39ec23272be52f158856756 to your computer and use it in GitHub Desktop.
purvalpatel

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.

Setup k8sgpt package:

Download K8sgpt for ubuntu:

curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.33/k8sgpt_amd64.deb

Install:

dpkg -i k8sgpt_amd64.deb

Kubernetes can sends the cluster diagnostics to OpenAI API's, but it is paid so we can use Local LLM.

Install k8sgpt on cluster or on local machine but make sure that cluster should be accessible via kubectl command.

Setup Local LLM if not exists.

Pull model in ollama if not available:

ollama pull qwen3:8b

Verify:

ollama list

Test:

curl http://localhost:11434/api/generate -d '{
  "model":"qwen3:8b",
  "prompt":"What is CrashLoopBackOff?"
}'

Configure k8sgpt:

Add ollama:

k8sgpt auth add \
  --backend localai \
  --baseurl http://localhost:11434/v1 \
  --model qwen3:8b

Set default provider:

k8sgpt auth default --provider localai

Check available providers:

k8sgpt auth list

Analyze cluster:

k8sgpt analyze

Explain with AI:

k8sgpt analyze --explain
image

Reference : https://github.com/k8sgpt-ai/k8sgpt

KubeGPT Dashboard : https://github.com/prerana-puttaswamy/kubegpt-dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment