Kubernetes Copilot
Project description
Autonomous Agent for Kubernetes
Autonomous Agent for Kubernetes powered by OpenAI.
Features:
- Autonomous Kubernetes cluster operations using LLM Agents powered by ChatGPT (GPT-3.5, GPT-4 and future versions).
- Diagnose and analyze the potential issues for Kubernetes workloads.
- Generate the Kubernetes manifests based on the provided prompt instructions.
- Utilize native kubectl and trivy commands for Kubernetes cluster access and security vulnerability scanning.
Install
Run in Kubernetes
kubectl run -it --rm copilot \
--env="OPENAI_API_KEY=$OPENAI_API_KEY" \
--restart=Never \
--image=ghcr.io/feiskyer/kube-agent \
-- execute --verbose 'What Pods are using max memory in the cluster'
kubectl run -it --rm copilot \
--env="AZURE_OPENAI_API_KEY=$AZURE_OPENAI_API_KEY" \
--env="AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT" \
--restart=Never \
--image=ghcr.io/feiskyer/kube-agent \
-- execute --verbose 'What Pods are using max memory in the cluster'
Refer kubernetes.md for more detailed steps.
Run locally
Install the copilot with pip command below:
pip install kube-agent
Setup:
- Ensure
kubectl
is installed on the local machine and the kubeconfig file is configured for Kubernetes cluster access. - Install
trivy
to assess container image security issues (for theaudit
command). - Set the OpenAI API key as the
OPENAI_API_KEY
environment variable to enable ChatGPT functionality.- For Azure OpenAI service, please set
AZURE_OPENAI_API_KEY=<key>
andAZURE_OPENAI_ENDPOINT=https://<replace-this>.openai.azure.com/
.
- For Azure OpenAI service, please set
How to use
Running directly in the terminal:
Usage: kube-agent [OPTIONS] COMMAND [ARGS]...
Kubernetes Copilot powered by OpenAI
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
analyze analyze issues for a given resource
audit audit security issues for a Pod
diagnose diagnose problems for a Pod
execute execute operations based on prompt instructions
generate generate Kubernetes manifests
Contribution
The project is opensource at github feiskyer/kube-agent with Apache License.
If you would like to contribute to the project, please follow these guidelines:
- Fork the repository and clone it to your local machine.
- Create a new branch for your changes.
- Make your changes and commit them with a descriptive commit message.
- Push your changes to your forked repository.
- Open a pull request to the main repository.
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
kube_agent-0.1.0.tar.gz
(18.1 kB
view hashes)
Built Distribution
kube_agent-0.1.0-py3-none-any.whl
(19.3 kB
view hashes)
Close
Hashes for kube_agent-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95ff8ea81c7b1ed991c2526f73fde572c3bc185902380e0d1badf50e2bd4d075 |
|
MD5 | 85bef14c8232353c32ce604b59a627c2 |
|
BLAKE2b-256 | 2bc5abcd039c4c05d1acb66ad3437c8e8a781269f3dba4bb100c6fa3e2c95c63 |