Training Our First Kubernetes Expert Model

Search for a command to run...

No comments yet. Be the first to comment.
Overview When debugging code inside a container, developers often need to build a new image and deploy a new pod, which can be slow and cumbersome. HotPod eliminates this hassle by allowing developers to copy updated files into a running container an...
Your team has 14 versions of the same code review skill across 5 repos, with no way to sync them. when one improves, the others don't. drop a folder in .claude/skills/ and pray nothing drifts. source

AI agents are unreasonably good at writing SQL. They get specific error messages, fix their own mistakes in one retry, and can introspect query performance with EXPLAIN ANALYZE before you even ask. No

n8n has over 400 integrations. Zapier claims 7,000+. Every single one was hand-built, tested against a moving API, and will eventually break when that API ships a v2. The entire workflow automation in

Part of the "Your Next Startup" series, where I break down startup ideas I think are worth building. Auth0 sold for \(6.5B. Okta is worth \)15B+. CyberArk, Delinea, BeyondTrust, all printing money fro

For as long as software has existed, we've been building two doors into our systems. Door one: the UI, a carefully designed surface where humans point, click, and occasionally rage-quit. Door two: the

We trained our first expert model in Kubernetes kubectl commands using a fine-tuning process on a specialized dataset. The dataset consists of structured prompt-command pairs where natural language queries are mapped to their respective kubectl commands. This allows the model to generalize and generate accurate kubectl commands for a variety of Kubernetes management tasks.
kubectl?General-purpose AI models lack deep Kubernetes knowledge and struggle with domain-specific queries. Our goal is to fine-tune a model that can:
Generate correct kubectl commands based on natural language input.
Explain command syntax and usage with step-by-step reasoning.
Identify potential errors and suggest fixes.
Model Selection: We use LLaMA 3.2-3B-Instruct, which balances efficiency and accuracy. It runs efficiently with 4-bit quantization, making it feasible for fine-tuning on consumer-grade GPUs.
Fine-Tuning with Unsloth: We streamline model training with LoRA adapters, reducing memory usage and improving efficiency.
Dataset Curation: We use multiple datasets to cover different aspects of kubectl usage:
Basic Commands: ComponentSoft/k8s-kubectl
Advanced Scenarios: ComponentSoft/k8s-kubectl-35k
Chain-of-Thought (CoT) Explanations: ComponentSoft/k8s-kubectl-cot-20k
Instruction-based Training: sozercan/k8s-instructions
Troubleshooting & Debugging: eliashasnat/k8s-qa
Deployment with Ollama: Ollama was selected for easy packaging and distribution, making it seamless to integrate into terminal-based applications.
Dataset Collection: We compiled a comprehensive dataset of kubectl commands mapped to natural language queries, covering a wide range of Kubernetes operations.
Preprocessing: We cleaned and structured the data to ensure consistency, removing redundant entries and normalizing formatting.
Fine-Tuning: We optimized the model using instruction-tuning techniques, allowing it to generate precise kubectl commands from user queries.
Validation: The trained model was rigorously tested against various Kubernetes scenarios to ensure accuracy and reliability.
Deployment: The final model was packaged as niradler/k8s-operator:latest for easy use within the KasK application.
KasK is an open-source terminal-based application designed to simplify your interaction with Kubernetes clusters. With KasK, you can ask natural language questions about your Kubernetes resources, and it will generate accurate kubectl commands to fetch the required details. The app also provides a JSON viewer to display and explore the command output in a structured and user-friendly way.
Natural Language Queries: Ask questions like "Show all running pods" or "List services in all namespaces," and KasK will generate the appropriate kubectl command.
JSON Viewer: View the output of kubectl commands in a tree-like structure with search and filtering capabilities.
Clipboard Integration: Copy selected JSON values to your clipboard for easy sharing or further use.
Dark Mode Support: Enhanced readability with dark mode styles.
Keyboard Shortcuts: Navigate and interact with the app efficiently using intuitive key bindings.

git clone https://github.com/niradler/kask.git
cd kask
pip install -r requirements.txt
python main.py
Write your query in the "Write your prompt here" text area. For example: Show all pods in the default namespace.
Click the "Prompt" button or press Enter to generate the kubectl command and view the output.
Use the JSON viewer to explore the output:
Search for specific keys or values.
Expand or collapse nodes.
Copy selected values to your clipboard.
Use keyboard shortcuts for quick actions:
x: Expand/Collapse all nodes.
s or /: Focus on the search bar.
c: Copy the selected value.
q: Quit the application.
Python 3.8 or higher
Ollama server with the niradler/k8s-operator:latest model:
Use the Modelfile
ollama create k8s-operator -f Modelfile
kubectl installed and configured to access your Kubernetes cluster.
Limit commands (read-only) or review before execution.
Compact table view.
Tools integration.
Chat memory.
Model selector.
Ollama configuration.
UI/UX improvements.
Submit prompt with keyboard.
With our first fine-tuned model powering KasK, weβre excited to continue improving Kubernetes management through AI-driven automation! π