Kubectl plugin for generating Kubernetes manifests using LLMs
Top 33.5% on sourcepulse
This project provides a kubectl
plugin that leverages Large Language Models (LLMs) to generate and apply Kubernetes manifests. It's designed for developers and operators who want to quickly create or modify Kubernetes configurations using natural language prompts, reducing the need to manually search for or write YAML.
How It Works
The plugin acts as a wrapper around LLM APIs, translating natural language requests into Kubernetes YAML manifests. It supports OpenAI, Azure OpenAI, and compatible endpoints. A key feature is the optional --use-k8s-api
flag, which enables the plugin to query the Kubernetes OpenAPI specification. This allows for more accurate manifest generation, including custom resource definitions (CRDs), by leveraging function calling capabilities of newer LLM models.
Quick Start & Requirements
brew tap sozercan/kubectl-ai && brew install kubectl-ai
kubectl krew index add kubectl-ai https://github.com/sozercan/kubectl-ai && kubectl krew install kubectl-ai/kubectl-ai
Highlighted Details
--use-k8s-api
flag for enhanced accuracy using Kubernetes OpenAPI Spec.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The plugin generates full manifests and does not inherently know the current state of the Kubernetes cluster. The --use-k8s-api
flag requires LLM models supporting function calling (e.g., 0613
or later).
6 months ago
1 week