Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: K8sAI – open-source GPT CLI tool for Kubernetes (github.com/wilson090)
9 points by wilson090 7 months ago | hide | past | favorite | 7 comments
Hey HN!

I wanted to share an open-source project I’ve been working on called k8sAI. It’s a personal AI Kubernetes expert that can answer questions about your cluster, suggests commands, and even executes relevant kubectl commands to help diagnose and suggest fixes to your cluster, all in the CLI!

As a relative newcomer to k8s, this tool has really streamlined my workflow. I can ask questions about my cluster, k8sAI will run kubectl commands to gather info, and then answer those question. It’s also found several issues in my cluster for me - all I’ve had to do is point it in the right direction. I’ve really enjoyed making and using this so I thought it could be useful for others. Added bonus is that you don’t need to copy and paste into ChatGPT anymore!

k8sAI operates with read-only kubectl commands to make sure your cluster stays safe.

All you need is an OpenAI API key and a valid kubectl config. Start chatting with k8sAI using:

$ pip install k8sAI

$ k8sAI chat Or to fix an issue: $ k8sAI fix -p="take a look at the failing pod in the test namespace"

Any and all feedback is appreciated. Looking forward to hearing what you all have to say!

Cheers!




Great work! Do you have plans to add support for other models (e.g. Gemini)? My understanding is some models are better optimized for recall of info from large corpuses like docs.


Yeah I would love to see that happen, feel free to open a problem on the GH


This is interesting. I’m far from being an infra engineer so if this actually makes managing kubernetes easier I would pay for a hosted option


Interesting... how did you do the scraping of the documentation?


I found the documentation for k8s (https://kubernetes.io/docs/home/) in this repo in PDF form: https://github.com/dohsimpson/kubernetes-doc-pdf, so this part ended up being pretty simple thanks to them! From there I used PyPDF to parse the docs for the vector store.

I haven't started digging into the RAG performance, so open to ideas on ways to improve this!


kubectl also offers the `kubectl explain someresourcekind.someproperty` command which might be a nice way to get docs / schemas for CRDs (custom resource definitions) - though you'd need your tool to essentially RAG from the cluster in question to introspect it this way which might be a bit hairy


I’ve noticed the GPT agent running kubectl explain when trying to diagnose an issue. I think it could be a nice enhancement to have a way to place that into the context ahead of time, but the commands would have to be a bit more rigid in that the user would have to specify the resource to explain ahead of time.

I’ll add an issue for this though since I think it could definitely improve the performance!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: