Skip to main content

Using human language to interact with Kubernetes

Project description

kubegpt

License: MIT

A command-line tool for using human language to interact with Kubernetes. Powered by OpenAI/GPT.

kubegpt will take your input like

kubegpt "Am I using GlusterFS as a storage class?"

It will generate a kubectl command to run to get information, read the results of the command and then interpret the results. It will use your local kubectl config and context to reach your k8s cluster.

kubectl get storageclass

An example of the output of the above command is:

$ kubegpt "Am I using GlusterFS as a storage class?"

> Entering new AgentExecutor chain...
 I need to use kubectl to query the storage class information.
Action: terminal
Action Input: kubectl get storageclass
Observation: NAME                 PROVISIONER          RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
hostpath (default)   docker.io/hostpath   Delete          Immediate           false                  14d

Thought: I can see the storage class is "hostpath" which is not GlusterFS.
Final Answer: No, you are not using GlusterFS as a storage class.

> Finished chain.

The data you see in Observation is real info returned from the kubectl command that the AI agent ran using whatever Kubernetes cluster is currently set in your kubectl context.

Installation

pip install kubegpt

Setup your OpenAI API key

export OPENAI_API_KEY=xxxx

# NOTE: you will need to add a credit card to the OpenAI dashboard for this to work.

And then ask away!

kubegpt "What kubernetes context am I using?"

WARNING

Use at your own risk! We tell the OpenAI agent mutliple times to only run non-destructive kubectl commands but this is not guaranteed. We are not responsible for any damage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kubegpt-0.0.7.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kubegpt-0.0.7-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file kubegpt-0.0.7.tar.gz.

File metadata

  • Download URL: kubegpt-0.0.7.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for kubegpt-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a40be20463e7fec982e895cdacc32c2870c7ad89a826ac0b7428f32425ba2fa6
MD5 3d50a91ee8cbc4b3e3ca99cfe3f8d7ed
BLAKE2b-256 a3cdbc42366fc06920257e0b15f0a6deadc663991cd7578012abc9ff88296c1e

See more details on using hashes here.

File details

Details for the file kubegpt-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: kubegpt-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for kubegpt-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b9459a6cb14c43781b38f44b5b5f6a543fae3cb96ebf07f7e6abe97573b8f863
MD5 bb07046f6400e66faeb19db4542864b9
BLAKE2b-256 556d7be147a6f9209bd5151e6a92635ee727faf8f3199e787796e628c238cd33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page