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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for agentk8s-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aa845b9808704416cb03e0260223f5843e158d025baa9cb2ba8707f4ded8184 |
|
MD5 | 640815b824d3165f7a8fcbff5749a3f3 |
|
BLAKE2b-256 | c409a81b425a13be30fcf40d64347adcf65a6bb5f004922438fad2e9d58bec33 |