Kube-Alfred is an AI-powered assistant for Kubernetes. It allows you to ask questions about Kubernetes directly from kubectl, providing intelligent responses using the Anthropic API.
If you have Krew installed, you can easily install kube-alfred:
kubectl krew install alfred
If you prefer to install manually:
- Download the appropriate version for your operating system and architecture from the releases page.
- Rename the downloaded file to
kubectl-alfred
. - Make it executable:
chmod +x kubectl-alfred
- Move it to a directory in your PATH, e.g.,
mv kubectl-alfred /usr/local/bin/
kubectl krew install --manifest=alfred.yaml --archive=foo.tar.gz
shasum -a 256 releases/download/<VERSION>/*.tar.gz
Once installed, you can use kube-alfred with the following commands:
kubectl alfred ask "<your question about Kubernetes>"
For example:
kubectl alfred ask "How do I create a deployment?"
To securely store your Anthropic API key in the system keyring:
kubectl alfred set-key <your-api-key>
To remove your Anthropic API key from the system keyring:
kubectl alfred del-key
Kube-Alfred now uses the system keyring to securely store your Anthropic API key. You only need to set it once using the set-key
command as shown above.
Here are a few example questions you can ask:
kubectl alfred ask "What is a Pod in Kubernetes?"
kubectl alfred ask "How do I troubleshoot a failing deployment?"
kubectl alfred ask "Explain Kubernetes Services and their types"
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please file an issue on the GitHub repository.
Kube-Alfred uses your system's keyring to store the Anthropic API key securely. This is generally more secure than storing it in plain text or environment variables. However, the security of the keyring depends on your operating system and its configuration. Always ensure you're following best practices for system security.