kubectl-ai
AI powered Kubernetes Assistant
A command-line tool that lets you manage Kubernetes clusters using plain English questions and instructions instead of memorizing kubectl commands and YAML syntax.
kubectl-ai is a command-line tool from Google that lets you manage a Kubernetes cluster by typing natural-language questions and instructions instead of having to know the exact kubectl commands. Kubernetes is a system for running and coordinating software applications across many servers. Managing it normally requires learning specific commands and YAML configuration files, which can be complex. kubectl-ai acts as an interpreter: you describe what you want in plain English, and it figures out the right operations to perform.
The tool supports a range of AI models. By default it uses Google's Gemini model, but you can configure it to use OpenAI's models, Grok from xAI, Claude models through Amazon's Bedrock service, or AI models running locally on your own computer through Ollama or llama.cpp. You connect the tool to whichever AI provider you prefer by setting an API key as an environment variable.
You can use it interactively, typing questions one after another in a conversational session, or run it as a one-liner by passing your question directly on the command line. It also accepts piped input, so you could, for example, paste an error log into it and ask for an explanation. Sessions can be saved to disk and resumed later, preserving the context from a previous conversation.
The tool integrates with the standard Kubernetes command-line interface and can be installed as a plugin that runs as "kubectl ai". Installation is available through a shell script, manual download, or package managers including Krew (the Kubernetes plugin manager) and Nix. It can also run as an MCP server, which allows other AI tools to use it as a backend for Kubernetes operations.
The project is published under the Google Cloud Platform organization on GitHub and is written in Go.
Where it fits
- Ask what pods are running in a cluster in plain English instead of writing kubectl commands
- Paste a Kubernetes error log and ask for a plain-English explanation and suggested fix
- Use conversational sessions to iteratively troubleshoot and reconfigure a Kubernetes cluster