Introducing K8sGPT: Giving AI Superpowers to Kubernetes Users

With all the hype around AI these days, you might have encountered hundreds of AI-based tools that can help make your life easier. What if I tell you that there’s a tool for Kubernetes…

You’ve probably come across numerous AI-based tools that promise to simplify your life, from AI-powered SEO optimization to tools that create images with just one sentence. As a DevOps enthusiast, I’ve encountered countless challenges and errors while working with Kubernetes, and whether you’re a seasoned professional or just starting out, you’ve likely faced your fair share of workload issues as well. But what if I told you there’s a tool that can scan your Kubernetes clusters, identify common problems, and offer precise error diagnoses based on codified SRE expertise, all with the help of AI?

Let me introduce you to K8sGPT.

What’s K8sGPT

According to the definition:

k8sgpt is a tool for scanning your kubernetes clusters, diagnosing and triaging issues in simple english. It has SRE experience codified into it’s analyzers and helps to pull out the most relevant information to enrich it with AI.

Sounds cool right? Getting SRE superpowers with a help of a tool that can find problems in your Kubernetes environment and solve them.

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.

K8sGPT provides a rich set of built in analyzers:

  • podAnalyzer
  • pvcAnalyzer
  • rsAnalyzer
  • serviceAnalyzer
  • eventAnalyzer
  • ingressAnalyzer
  • statefulSetAnalyzer
  • deploymentAnalyzer
  • cronJobAnalyzer
  • nodeAnalyzer
  • hpaAnalyzer (optional)
  • pdbAnalyzer (optional)
  • networkPolicyAnalyzer (optional)

How to Use it

Installation:

brew tap k8sgpt-ai/k8sgpt
brew install k8sgpt

For other installation methods check out here.

Try to run a scan with the default analyzers:

k8sgpt generate
k8sgpt auth
k8sgpt analyze --explain

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

If you wish to learn more about K8sGPT, you can visit their GitHub or join their Slack.

Thanks for reading!

Edit this page

Hongchao Deng (邓洪超)
Hongchao Deng (邓洪超)
Entrepreneur, Technologist

My research interests include programming, artificial intelligence, Kubernetes and infrastructure matter.

Next
Previous