Skip to main content

k8s agent that does all the work for you.

Project description

KGPT

KGPT, or Kubernetes General Purpose Tasker, is a cutting-edge Kubernetes agent designed to simplify and streamline the management of complex and manual tasks within your Kubernetes cluster. In the dynamic world of container orchestration and cloud-native computing, KGPT emerges as a powerful ally, offering automation and intelligence to help you efficiently handle a wide range of tasks, from deployment and scaling to monitoring and troubleshooting. This innovative agent is engineered to alleviate the burden of manual interventions, enhancing the agility and reliability of your Kubernetes infrastructure. With KGPT at your side, you can confidently navigate the intricate landscape of Kubernetes, ensuring optimal performance and resource utilization while freeing up valuable time for more strategic endeavors.

Install

Prerequisites

  • You already setup an k8s cluster locally or on the cloud, and kubectl is working normally
  • You need Python and pip installed
  • openAI GPT-4 API key ready

Supported python version 3.8 | 3.9 | 3.10 | 3.11

pip install agentk8s

Install auto completion (optional)

kgpt --install-completion

Example

1. call the setup command to enter your GPT-4 api-key

kgpt setup

2. Now try a few command, like setup an deployment and a service.

kgpt chat "create an deployment called mynginx, image name is nginx, three replicas, expose port 80"

After a few seconds you should see the following output if everything is executed successfully.

user_proxy (to assistant):

exitcode: 0 (execution succeeded)
Code output: 
deployment.apps/mynginx created

service/mynginx exposed

3. We can also modify a resource in the cluster, let's change the mynginx service target port to 8001

kgpt chat "Change mynginx service's target port to 8001"

If everything is executed successfully, you should see the following output

exitcode: 0 (execution succeeded)
Code output: 
service/mynginx patched

4. Now let's delete the resource we just created.

kgpt chat "delete mynginx deployment and service"

You should be able to see the following output, if everything is executed successfully.

user_proxy (to assistant):

exitcode: 0 (execution succeeded)
Code output: 
deployment.apps "mynginx" deleted
service "mynginx" deleted

List of possible tasks

  • "create an deployment called mynginx, image name is nginx, three replicas, expose port 80"
  • "change mynginx service's target port to 8001"
  • "delete mynginx deployment and service"
  • "remove all deployment and service in namespace model"
  • "watch the status of deployment nginx"
  • "list all deployment and service"
  • "list all running deployment with more than two replica"
  • "create a namespace called test"
  • "create a namespace called gpu and change the nginx deployment's namespace to gpu"
  • "remove the namespace gpu if no deployment with the namespace gpu"
  • "create a docker-registry secret called my-docker-secret, the docker server is mydocker.io usename is vurtne and the password is yqxzv193"
For more possible tasks that the agent can do please checkout here

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

agentk8s-0.1.9.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

agentk8s-0.1.9-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

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