Home

Awesome

Kubectl-GPT: Kubenetes cli powered by GPT | Quick Hack

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.

https://user-images.githubusercontent.com/7579608/232610592-b95ead34-3d9e-424f-8069-cf8ce8e48f98.mp4

📋 Requirements

⚠️ OpenAI API Keys Configuration ⚠️

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.

For OpenAI API key to work, set up paid account at OpenAI API > Billing

PLEASE ENSURE YOU HAVE DONE THIS STEP BEFORE PROCEEDING, OTHERWISE NOTHING WILL WORK!

💾 Installation

To try Kubectl-GPT, follow these steps:

  1. Make sure you have all the requirements listed above, if not, install/get them

  2. Clone the repository:

        git clone https://github.com/abhishek-ch/Kubectl-GPT.git
    
  3. Navigate to the directory where the repository was downloaded

    cd Kubectl-GPT
    
  4. Install the required dependencies

    pip install -r requirements.txt
    
  5. 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 the Kubectl-GPT dir & update either Azure or OpenAI config

    By completing these steps, you have properly configured the API Keys for your project.

🔧 Usage

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"