{"id":17497161,"url":"https://github.com/feiskyer/kube-copilot","last_synced_at":"2025-04-07T18:13:34.812Z","repository":{"id":147389864,"uuid":"618761815","full_name":"feiskyer/kube-copilot","owner":"feiskyer","description":"Kubernetes Copilot powered by OpenAI","archived":false,"fork":false,"pushed_at":"2024-05-06T11:01:34.000Z","size":764,"stargazers_count":124,"open_issues_count":0,"forks_count":19,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-08T00:28:31.333Z","etag":null,"topics":["agent","chatgpt","copilot","kubernetes","openai"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feiskyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-25T09:19:59.000Z","updated_at":"2024-06-21T19:37:53.707Z","dependencies_parsed_at":"2024-02-18T06:19:52.868Z","dependency_job_id":"398f8a03-2d99-4f75-aad2-abfd3ce8bcd4","html_url":"https://github.com/feiskyer/kube-copilot","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Fkube-copilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Fkube-copilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Fkube-copilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feiskyer%2Fkube-copilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feiskyer","download_url":"https://codeload.github.com/feiskyer/kube-copilot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704571,"owners_count":20982298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","chatgpt","copilot","kubernetes","openai"],"created_at":"2024-10-19T15:15:00.369Z","updated_at":"2025-04-07T18:13:34.805Z","avatar_url":"https://github.com/feiskyer.png","language":"Go","funding_links":[],"categories":["Go","Domain-Specific Tools","LLM-Powered DevOps Tools"],"sub_categories":["Cloud \u0026 DevOps"],"readme":"# Kubernetes Copilot\n\nKubernetes Copilot powered by LLM, which leverages advanced language models to streamline and enhance Kubernetes cluster management. This tool integrates seamlessly with your existing Kubernetes setup, providing intelligent automation, diagnostics, and manifest generation capabilities. By utilizing the power of AI, Kubernetes Copilot simplifies complex operations and helps maintain the health and security of your Kubernetes workloads.\n\n## Features\n\n- Automate Kubernetes cluster operations using large language models.\n- Provide your own OpenAI, Azure OpenAI, Anthropic Claude, Google Gemini or other OpenAI-compatible LLM providers.\n- Diagnose and analyze potential issues for Kubernetes workloads.\n- Generate Kubernetes manifests based on provided prompt instructions.\n- Utilize native `kubectl` and `trivy` commands for Kubernetes cluster access and security vulnerability scanning.\n- Access the web and perform Google searches without leaving the terminal.\n\n## Installation\n\nInstall the kube-copilot CLI with the following command:\n\n```sh\ngo install github.com/feiskyer/kube-copilot/cmd/kube-copilot@latest\n```\n\n## Quick Start\n\nSetup the following environment variables:\n\n- Ensure [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/) is installed on the local machine and the kubeconfig file is configured for Kubernetes cluster access.\n- Install [`trivy`](https://github.com/aquasecurity/trivy) to assess container image security issues (only required for the `audit` command).\n- Set the OpenAI [API key](https://platform.openai.com/account/api-keys) as the `OPENAI_API_KEY` environment variable to enable LLM AI functionality (refer below for other LLM providers).\n\nThen run the following commands directly in the terminal:\n\n```sh\nKubernetes Copilot powered by OpenAI\n\nUsage:\n  kube-copilot [command]\n\nAvailable Commands:\n  analyze     Analyze issues for a given resource\n  audit       Audit security issues for a Pod\n  completion  Generate the autocompletion script for the specified shell\n  diagnose    Diagnose problems for a Pod\n  execute     Execute operations based on prompt instructions\n  generate    Generate Kubernetes manifests\n  help        Help about any command\n  version     Print the version of kube-copilot\n\nFlags:\n  -c, --count-tokens         Print tokens count\n  -h, --help                 help for kube-copilot\n  -x, --max-iterations int   Max iterations for the agent running (default 10)\n  -t, --max-tokens int       Max tokens for the GPT model (default 2048)\n  -m, --model string         OpenAI model to use (default \"gpt-4\")\n  -v, --verbose              Enable verbose output\n      --version              version for kube-copilot\n\nUse \"kube-copilot [command] --help\" for more information about a command.\n```\n\n## LLM Integrations\n\n\u003cdetails\u003e\n\u003csummary\u003eOpenAI\u003c/summary\u003e\n\nSet the OpenAI [API key](https://platform.openai.com/account/api-keys) as the `OPENAI_API_KEY` environment variable to enable OpenAI functionality.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAnthropic Claude\u003c/summary\u003e\n\nAnthropic Claude provides an [OpenAI compatible API](https://docs.anthropic.com/en/api/openai-sdk), so it could be used by using following config:\n\n- `OPENAI_API_KEY=\u003cyour-anthropic-key\u003e`\n- `OPENAI_API_BASE='https://api.anthropic.com/v1/'`\n\n\u003c/details\u003e\n\n\u003csummary\u003eAzure OpenAI\u003c/summary\u003e\n\nFor [Azure OpenAI service](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/quickstart?tabs=command-line\u0026pivots=rest-api#retrieve-key-and-endpoint), set the following environment variables:\n\n- `AZURE_OPENAI_API_KEY=\u003cyour-api-key\u003e`\n- `AZURE_OPENAI_API_BASE=https://\u003creplace-this\u003e.openai.azure.com/`\n- `AZURE_OPENAI_API_VERSION=2025-03-01-preview`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGoogle Gemini\u003c/summary\u003e\n\nGoogle Gemini provides an OpenAI compatible API, so it could be used by using following config:\n\n- `OPENAI_API_KEY=\u003cyour-google-ai-key\u003e`\n- `OPENAI_API_BASE='https://generativelanguage.googleapis.com/v1beta/openai/'`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eOllama or other OpenAI compatible LLMs\u003c/summary\u003e\n\nFor Ollama or other OpenAI compatible LLMs, set the following environment variables:\n\n- `OPENAI_API_KEY=\u003cyour-api-key\u003e`\n- `OPENAI_API_BASE='http://localhost:11434/v1'` (or your own base URL)\n\n\u003c/details\u003e\n\n## Key Features\n\n\u003cdetails\u003e\n\u003csummary\u003eAnalyze issues for a given kubernetes resource\u003c/summary\u003e\n\n`kube-copilot analyze [--resource pod] --name \u003cresource-name\u003e [--namespace \u003cnamespace\u003e]` will analyze potential issues for the given resource object:\n\n```sh\nAnalyze issues for a given resource\n\nUsage:\n  kube-copilot analyze [flags]\n\nFlags:\n  -h, --help               help for analyze\n  -n, --name string        Resource name\n  -s, --namespace string   Resource namespace (default \"default\")\n  -r, --resource string    Resource type (default \"pod\")\n\nGlobal Flags:\n  -c, --count-tokens         Print tokens count\n  -x, --max-iterations int   Max iterations for the agent running (default 10)\n  -t, --max-tokens int       Max tokens for the GPT model (default 2048)\n  -m, --model string         OpenAI model to use (default \"gpt-4o\")\n  -v, --verbose              Enable verbose output\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAudit Security Issues for Pod\u003c/summary\u003e\n\n`kube-copilot audit --name \u003cpod-name\u003e [--namespace \u003cnamespace\u003e]` will audit security issues for a Pod:\n\n```sh\nAudit security issues for a Pod\n\nUsage:\n  kube-copilot audit [flags]\n\nFlags:\n  -h, --help               help for audit\n  -n, --name string        Resource name\n  -s, --namespace string   Resource namespace (default \"default\")\n\nGlobal Flags:\n  -c, --count-tokens         Print tokens count\n  -x, --max-iterations int   Max iterations for the agent running (default 10)\n  -t, --max-tokens int       Max tokens for the GPT model (default 2048)\n  -m, --model string         OpenAI model to use (default \"gpt-4o\")\n  -v, --verbose              Enable verbose output\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eDiagnose Problems for Pod\u003c/summary\u003e\n\n`kube-copilot diagnose --name \u003cpod-name\u003e [--namespace \u003cnamespace\u003e]` will diagnose problems for a Pod:\n\n```sh\nDiagnose problems for a Pod\n\nUsage:\n  kube-copilot diagnose [flags]\n\nFlags:\n  -h, --help               help for diagnose\n  -n, --name string        Resource name\n  -s, --namespace string   Resource namespace (default \"default\")\n\nGlobal Flags:\n  -c, --count-tokens         Print tokens count\n  -x, --max-iterations int   Max iterations for the agent running (default 10)\n  -t, --max-tokens int       Max tokens for the GPT model (default 2048)\n  -m, --model string         OpenAI model to use (default \"gpt-4o\")\n  -v, --verbose              Enable verbose output\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eExecute operations based on prompt instructions\u003c/summary\u003e\n\n`kube-copilot execute --instructions \u003cinstructions\u003e` will execute operations based on prompt instructions.\nIt could also be used to ask any questions.\n\n```sh\nExecute operations based on prompt instructions\n\nUsage:\n  kube-copilot execute [flags]\n\nFlags:\n  -h, --help                  help for execute\n  -i, --instructions string   instructions to execute\n\nGlobal Flags:\n  -c, --count-tokens         Print tokens count\n  -x, --max-iterations int   Max iterations for the agent running (default 10)\n  -t, --max-tokens int       Max tokens for the GPT model (default 2048)\n  -m, --model string         OpenAI model to use (default \"gpt-4o\")\n  -v, --verbose              Enable verbose output\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGenerate Kubernetes Manifests\u003c/summary\u003e\n\nUse the `kube-copilot generate --prompt \u003cprompt\u003e` command to create Kubernetes manifests based on\nthe provided prompt instructions. After generating the manifests, you will be\nprompted to confirm whether you want to apply them.\n\n```sh\nGenerate Kubernetes manifests\n\nUsage:\n  kube-copilot generate [flags]\n\nFlags:\n  -h, --help            help for generate\n  -p, --prompt string   Prompts to generate Kubernetes manifests\n\nGlobal Flags:\n  -c, --count-tokens         Print tokens count\n  -x, --max-iterations int   Max iterations for the agent running (default 10)\n  -t, --max-tokens int       Max tokens for the GPT model (default 2048)\n  -m, --model string         OpenAI model to use (default \"gpt-4o\")\n  -v, --verbose              Enable verbose output\n```\n\n\u003c/details\u003e\n\n## Integrations\n\n\u003cdetails\u003e\n\u003csummary\u003eGoogle Search\u003c/summary\u003e\n\nLarge language models are trained with outdated data, and hence may lack the most current information or miss out on recent developments. This is where Google Search becomes an optional tool. By integrating real-time search capabilities, LLMs can access the latest data, ensuring that responses are not only accurate but also up-to-date.\n\nTo enable it, set `GOOGLE_API_KEY` and `GOOGLE_CSE_ID` (obtain API key from [Google Cloud](https://cloud.google.com/docs/authentication/api-keys?visit_id=638154888929258210-4085587461) and CSE ID from [Google CSE](http://www.google.com/cse/)).\n\u003c/details\u003e\n\n## Python Version\n\nPlease refer [feiskyer/kube-copilot-python](https://github.com/feiskyer/kube-copilot-python) for the Python implementation of the same project.\n\n## Contribution\n\nThe project is opensource at github [feiskyer/kube-copilot](https://github.com/feiskyer/kube-copilot) (Go) and [feiskyer/kube-copilot-python](https://github.com/feiskyer/kube-copilot-python) (Python) with Apache License.\n\nIf you would like to contribute to the project, please follow these guidelines:\n\n1. Fork the repository and clone it to your local machine.\n2. Create a new branch for your changes.\n3. Make your changes and commit them with a descriptive commit message.\n4. Push your changes to your forked repository.\n5. Open a pull request to the main repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeiskyer%2Fkube-copilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeiskyer%2Fkube-copilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeiskyer%2Fkube-copilot/lists"}