Kubectl-GPT is an experimental open-source tool designed for running kubectl commands using GPT. The tool is powered by GPT3.5 and Langchain
Searching for the exact kubectl command can be challenging, so this is a convenient way to find it.
3.mp4
- Python 3.10 or later (instructions: for Windows)
- OpenAI API key
- Kubernetes Installed
- Kubectl Installed
Obtain your OpenAI API key from: https://platform.openai.com/account/api-keys.
To use OpenAI API key for Auto-GPT, you NEED to have billing set up (AKA paid account).
You can set up paid account at https://platform.openai.com/account/billing/overview.
To try Kubectl-GPT, follow these steps:
-
Make sure you have all the requirements listed above, if not, install/get them
-
Clone the repository:
git clone https://github.com/abhishek-ch/Kubectl-GPT.git
-
Navigate to the directory where the repository was downloaded
cd Kubectl-GPT
-
Install the required dependencies
pip install -r requirements.txt
-
Configure OpenAI Key
- If Using OpenAI key, simply
export OPENAI_API_KEY=*****
- If want to use config file, rename
config_template.ini
->config.ini
file inside theKubectl-GPT
dir & update either Azure or OpenAI config
By completing these steps, you have properly configured the API Keys for your project.
- See OpenAI API Keys Configuration to obtain your OpenAI API key.
- Details can be found here: https://pypi.org/project/openai/ in the
Microsoft Azure Endpoints
section and here: https://learn.microsoft.com/en-us/azure/cognitive-services/openai/tutorials/embeddings?tabs=command-line for the embedding model.
- If Using OpenAI key, simply
Run Kubectl-GPT
Python module in your terminal
python -m kgpt "list all pods"
python -m kgpt "what is the cpu usage of the pod testing in the namespace xyz"