├── CNAME ├── docs ├── CNAME ├── imgs │ ├── bedrock.png │ ├── grafana.png │ ├── operator.png │ ├── icon-logo-01.png │ ├── generate-token.png │ └── icon-logo-01.svg ├── tutorials │ ├── index.md │ ├── playground.md │ ├── observability.md │ ├── slack-integration.md │ ├── content-collection │ │ └── content-collection.md │ ├── custom-analyzers.md │ └── custom-rest-backend.md ├── build │ ├── Dockerfile │ └── requirements.txt ├── reference │ ├── guidelines │ │ ├── community.md │ │ ├── guidelines.md │ │ └── privacy.md │ ├── cli │ │ ├── serve-mode.md │ │ ├── debugging.md │ │ ├── index.md │ │ └── filters.md │ ├── operator │ │ ├── advanced-installation.md │ │ └── overview.md │ └── providers │ │ └── backend.md ├── index.md ├── getting-started │ ├── Community.md │ ├── in-cluster-operator.md │ ├── installation.md │ └── getting-started.md └── explanation │ ├── integrations.md │ └── caching.md ├── .codespellignore ├── .github └── workflows │ ├── typos.yml │ └── mkdocs.yml ├── Makefile ├── README.md ├── mkdocs.yml └── LICENSE /CNAME: -------------------------------------------------------------------------------- 1 | docs.k8sgpt.ai 2 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | docs.k8sgpt.ai 2 | -------------------------------------------------------------------------------- /docs/imgs/bedrock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k8sgpt-ai/docs/HEAD/docs/imgs/bedrock.png -------------------------------------------------------------------------------- /docs/imgs/grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k8sgpt-ai/docs/HEAD/docs/imgs/grafana.png -------------------------------------------------------------------------------- /docs/imgs/operator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k8sgpt-ai/docs/HEAD/docs/imgs/operator.png -------------------------------------------------------------------------------- /docs/imgs/icon-logo-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k8sgpt-ai/docs/HEAD/docs/imgs/icon-logo-01.png -------------------------------------------------------------------------------- /docs/imgs/generate-token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k8sgpt-ai/docs/HEAD/docs/imgs/generate-token.png -------------------------------------------------------------------------------- /.codespellignore: -------------------------------------------------------------------------------- 1 | k8sgpt 2 | 3 | k8sgptdocs 4 | 5 | K8sGPT 6 | 7 | helm 8 | 9 | Kubernetes 10 | 11 | kubectl -------------------------------------------------------------------------------- /docs/tutorials/index.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | This section provides: 4 | 5 | * end-to-end tutorials on specific use cases 6 | * a collection of user and contributor created content -------------------------------------------------------------------------------- /.github/workflows/typos.yml: -------------------------------------------------------------------------------- 1 | name: typos 2 | 3 | on: 4 | pull_request: 5 | paths-ignore: 6 | - '*.md' 7 | 8 | jobs: 9 | build: 10 | name: Detect typos 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v3 15 | - name: Run typo checks 16 | run: make typos -------------------------------------------------------------------------------- /docs/build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM squidfunk/mkdocs-material:latest 2 | 3 | ## If you want to see exactly the same version as is published to GitHub pages 4 | ## use a private image for insiders, which requires authentication. 5 | 6 | # docker login -u ${GITHUB_USERNAME} -p ${GITHUB_TOKEN} ghcr.io 7 | # FROM ghcr.io/squidfunk/mkdocs-material-insiders 8 | 9 | COPY requirements.txt . 10 | RUN pip install -r requirements.txt 11 | -------------------------------------------------------------------------------- /docs/reference/guidelines/community.md: -------------------------------------------------------------------------------- 1 | # Community Information 2 | 3 | All community related information are kept in a separate repository from the docs. 4 | 5 | Link to the repository: [k8sgpt-ai/community](https://github.com/k8sgpt-ai/community) 6 | 7 | There you will find information on 8 | 9 | * The Charter 10 | * Adopters List 11 | * Code of Conduct 12 | * Community Members 13 | * Subprojects 14 | 15 | and much more. -------------------------------------------------------------------------------- /docs/tutorials/playground.md: -------------------------------------------------------------------------------- 1 | # K8sGPT Playground 2 | 3 | If you want to try out K8sGPT, we highly suggest you to follow this Killercoda example: 4 | 5 | Link: [**K8sGPT CLI Tutorial**](https://killercoda.com/matthisholleville/scenario/k8sgpt-cli) 6 | 7 | This tutorial covers: 8 | 9 | - Run a simple analysis and explore possible options 10 | - Discover how AI works Explanation 11 | - Stay on the down-low with the anonymize option (because we don't want any trouble with the feds) 12 | - Filter resources like a boss 13 | - Use Integrations 14 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # K8sGPT Documentation 2 | 3 | K8sGPT gives Kubernetes SRE superpowers to everyone 4 | 5 | **The documentation provides the following** 6 | 7 | * Getting started: Guides to install and use K8sGPT 8 | * Tutorials: End-to-end tutorials on specific use cases 9 | * Reference: Specific documentation on the features 10 | * Explanation: Additional explanations on the design and use of the CLI 11 | 12 | ## Documentation enhancements 13 | 14 | If anything is unclear please create an issue in the [docs repository.](https://github.com/k8sgpt-ai/docs) -------------------------------------------------------------------------------- /.github/workflows/mkdocs.yml: -------------------------------------------------------------------------------- 1 | name: mkdocs 2 | on: 3 | push: 4 | branches: 5 | - main 6 | permissions: 7 | contents: write 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-python@v4 14 | with: 15 | python-version: 3.12 16 | - uses: actions/cache@v3 17 | with: 18 | key: ${{ github.ref }} 19 | path: .cache 20 | - run: | 21 | pip install -r docs/build/requirements.txt 22 | - run: mkdocs gh-deploy --force -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MKDOCS_IMAGE := ghcr.io/k8sgpt-ai/k8sgptdocs:dev 2 | MKDOCS_PORT := 8000 3 | 4 | .PHONY: mkdocs-serve 5 | mkdocs-serve: 6 | docker build -t $(MKDOCS_IMAGE) -f docs/build/Dockerfile docs/build 7 | docker run --name mkdocs-serve --rm -v $(PWD):/docs -p $(MKDOCS_PORT):8000 $(MKDOCS_IMAGE) 8 | 9 | .PHONY: typos 10 | typos: 11 | which codespell || pip install codespell 12 | codespell -S _examples,.tfsec,.terraform,.git,go.sum --ignore-words .codespellignore -f 13 | 14 | .PHONY: fix-typos 15 | fix-typos: 16 | which codespell || pip install codespell 17 | codespell -S .terraform,go.sum --ignore-words .codespellignore -f -w -i1 -------------------------------------------------------------------------------- /docs/build/requirements.txt: -------------------------------------------------------------------------------- 1 | click==8.1.7 2 | csscompressor==0.9.5 3 | ghp-import==2.1.0 4 | htmlmin==0.1.12 5 | importlib-metadata==7.0.1 6 | Jinja2==3.1.2 7 | jsmin==3.0.1 8 | Markdown==3.5.1 9 | MarkupSafe==2.1.3 10 | mergedeep==1.3.4 11 | mike==2.0.0 12 | mkdocs==1.5.3 13 | mkdocs-macros-plugin==1.0.5 14 | mkdocs-material==9.5.3 15 | mkdocs-material-extensions==1.3.1 16 | mkdocs-minify-plugin==0.7.2 17 | mkdocs-redirects==1.2.1 18 | packaging==23.2 19 | Pygments==2.17.2 20 | pymdown-extensions==10.7 21 | pyparsing==3.1.1 22 | python-dateutil==2.8.2 23 | PyYAML==6.0.1 24 | pyyaml_env_tag==0.1 25 | six==1.16.0 26 | termcolor==2.4.0 27 | verspec==0.1.0 28 | watchdog==3.0.0 29 | zipp==3.17.0 30 | -------------------------------------------------------------------------------- /docs/reference/guidelines/guidelines.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## Contributing to the Documentation 4 | 5 | This documentation follows the [Diataxis](https://diataxis.fr/) framework. 6 | If you are proposing completely new content to the documentation, please familiarise yourself with the framework first. 7 | 8 | The documentation is created with [mkdocs](https://www.mkdocs.org/), specifically the [Material for MkDocs theme](https://squidfunk.github.io/mkdocs-material/getting-started/). 9 | 10 | ## Contributing projects in the K8sGPT organisation 11 | 12 | All projects in the K8sGPT organisation follow our [contributing guidelines.](https://github.com/k8sgpt-ai/k8sgpt/blob/main/CONTRIBUTING.md) -------------------------------------------------------------------------------- /docs/getting-started/Community.md: -------------------------------------------------------------------------------- 1 | ## GitHub 2 | 3 | The [k8sgpt source code](https://github.com/k8sgpt-ai/k8sgpt) and other related projects managed on github are in the [k8sgpt](https://github.com/k8sgpt-ai) organization. 4 | 5 | 6 | ## Slack Channel 7 | 8 | You can join the slack channel using the link : [slack](https://join.slack.com/t/k8sgpt/shared_invite/zt-276pa9uyq-pxAUr4TCVHubFxEvLZuT1Q) 9 | 10 | 11 | ## Community Meetings / Office Hours 12 | 13 | These happen on 1st and 3rd Thursday of the month Time zone: Europe/London Time: 12:00 - 13:00 Joining Info: 14 | 15 | Google Meet : [link](https://meet.google.com/beu-kbdx-dfa) 16 | 17 | Calendar Link : [calendar schedule](https://calendar.google.com/calendar/u/0?cid=YmE2NzAyZTNkMTIxYjYxN2Q4NmMzYjBjMmE2ZTAzYzgwMTg0NGRiYmMwOTY3MjAzNzJkNDBhZWZjOWJhZGNlNUBncm91cC5jYWxlbmRhci5nb29nbGUuY29t) 18 | 19 | ## Contributing 20 | 21 | Thanks for your interest in contributing! We welcome all types of contributions and encourage you to read our [contribution guidelines](https://github.com/k8sgpt-ai/k8sgpt/blob/main/CONTRIBUTING.md) for next steps. 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/tutorials/observability.md: -------------------------------------------------------------------------------- 1 | # Integrating Observability with K8sGPT 2 | 3 | Enhance your Kubernetes observability by integrating Prometheus and Grafana with K8sGPT. Follow these steps to set up and visualize your cluster's insights: 4 | ## Prerequisites 5 | - Prometheus: Install using Helm via Prometheus Community Helm Charts. 6 | - Grafana Dashboard: Ensure Grafana is installed and accessible in your environment. 7 | 8 | # Installation Steps 9 | 10 | Install the K8sGPT Operator with observability features enabled: 11 | ``` 12 | helm install release k8sgpt/k8sgpt-operator -n k8sgpt-operator-system --create-namespace --set interplex.enabled=true --set grafanaDashboard.enabled=true --set serviceMonitor.enabled=true 13 | ``` 14 | This command: 15 | - Creates a ServiceMonitor to integrate with Prometheus. 16 | - Automatically configures and populates data into your Grafana dashboard. 17 | 18 | Once set up, you can explore key metrics like: 19 | - Results identified by K8sGPT. 20 | - Operator workload details, providing insight into resource usage and efficiency. 21 | 22 | 23 | _See example of a K8sGPT Grafana dashboard_ 24 | 25 | ![Generate a token on the OpenAI website](../imgs/grafana.png) -------------------------------------------------------------------------------- /docs/imgs/icon-logo-01.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/tutorials/slack-integration.md: -------------------------------------------------------------------------------- 1 | # Integrate K8sGPT operator with Slack 2 | ## Slack prerequisites 3 | - Create a slack channel 4 | - Create a slack app 5 | - Enable and create an incoming webhook 6 | - Copy the webhook URL value 7 | 8 | You can follow Slack's documentation to create the [webhook](https://api.slack.com/messaging/webhooks) 9 | 10 | ## Configure the K8sGPT operator 11 | 12 | Install the operator with HELM 13 | ```bash 14 | helm repo add k8sgpt https://charts.k8sgpt.ai/ 15 | helm repo update 16 | helm install release k8sgpt/k8sgpt-operator -n k8sgpt-operator-system --create-namespace 17 | ``` 18 | Create OpenAI's secret 19 | ```bash 20 | kubectl create secret generic k8sgpt-sample-secret --from-literal=openai-api-key=$OPENAI_TOKEN -n k8sgpt-operator-system 21 | ``` 22 | 23 | Last but not least, deploy your K8sGPT Custom Resource 24 | ```yaml 25 | kubectl apply -f - << EOF 26 | apiVersion: core.k8sgpt.ai/v1alpha1 27 | kind: K8sGPT 28 | metadata: 29 | name: k8sgpt-sample 30 | namespace: k8sgpt-operator-system 31 | spec: 32 | ai: 33 | enabled: true 34 | model: gpt-4o-mini 35 | backend: openai 36 | secret: 37 | name: k8sgpt-sample-secret 38 | key: openai-api-key 39 | noCache: false 40 | version: v0.3.8 41 | sink: 42 | type: slack 43 | webhook: 44 | EOF 45 | ``` 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # K8sGPT Documentation 2 | 3 | K8sGPT gives Kubernetes SRE superpowers to everyone 4 | 5 | **The documentation provides the following** 6 | 7 | * Getting started: Guides to install and use K8sGPT 8 | * Tutorials: End-to-end tutorials on specific use cases 9 | * Reference: Specific documentation on the features 10 | * Explanation: Additional explanations on the design and use of the CLI 11 | 12 | ## Documentation enhancements 13 | 14 | If anything is unclear please create an issue in the [docs repository.](https://github.com/k8sgpt-ai/docs) 15 | 16 | ## Running the documentation locally 17 | 18 | **Prerequisites** 19 | 20 | * Docker installed and running 21 | 22 | Clone the repository 23 | ```bash 24 | git clone git@github.com:k8sgpt-ai/docs.git 25 | ``` 26 | 27 | And then from within the docs repository, you can start the development server: 28 | ```bash 29 | make mkdocs-serve 30 | ``` 31 | 32 | ## Contributing 33 | This documentation follows the [Diataxis](https://diataxis.fr/) framework. 34 | If you are proposing completely new content to the documentation, please familiarise yourself with the framework first. The different directories in the documentation correspond to sections explored in the framework. 35 | 36 | The contribution guidelines to the documentation are the same as for the main project: [K8sGPT contributing guidelines](https://github.com/k8sgpt-ai/k8sgpt/blob/main/CONTRIBUTING.md) -------------------------------------------------------------------------------- /docs/explanation/integrations.md: -------------------------------------------------------------------------------- 1 | # Integrations 2 | 3 | Integrations in k8sGPT allows you to manage and configure various integrations with external tools and services within your repository's codebase. 4 | 5 | These integrations enhance the functionality of k8sGPT by providing additional capabilities for scanning, diagnosing, and triaging issues in the Kubernetes clusters. 6 | 7 | ## Description 8 | 9 | The `integration` command in the k8sgpt enables seamless integration with external tools and services. It allows you to activate, configure, and manage integrations that complement the functionalities of k8sgpt. 10 | 11 | Integrations are designed to interact with external systems and tools that complement the functionalities of k8sgpt. These integrations include vulnerability scanners, monitoring services, incident management platforms, and more. 12 | 13 | By using the following command users can access all K8sGPT CLI options related to integrations: 14 | 15 | ``` 16 | k8sgpt integrations --help 17 | ``` 18 | 19 | By leveraging the `integration` feature in the K8sGPT CLI, users can extend the functionality of K8sGPT by incorporating various external tools and services. 20 | This collaboration enhances the ability to diagnose and triage issues in Kubernetes clusters more effectively. 21 | 22 | For more information about each `integration` and its specific configuration options, refer to the [reference](https://docs.k8sgpt.ai/reference/cli/filters/) documentation provided for the integration. 23 | -------------------------------------------------------------------------------- /docs/tutorials/content-collection/content-collection.md: -------------------------------------------------------------------------------- 1 | # Content Collection 2 | 3 | This section provides a collection of videos, blog posts and more on K8sGPT, posted on external sites. 4 | 5 | ## Blogs 6 | Have a look at the K8sGPT blog on the [website.](https://k8sgpt.ai/blog/) 7 | 8 | Additionally, here are several blogs created by the community: 9 | 10 | * [K8sGPT + LocalAI: Unlock Kubernetes superpowers for free!](https://itnext.io/k8sgpt-localai-unlock-kubernetes-superpowers-for-free-584790de9b65) by Tyler Gillson 11 | * [K8sGPT: Simplifying Kubernetes Diagnostics with Natural Language Processing](https://www.kubetools.io/kubernetes/k8sgpt-simplifying-kubernetes-diagnostics-with-natural-language-processing/) by Karan Singh 12 | * [Kubernetes + ChatGPT = K8sGpt](https://medium.com/@vijulpatel865/kubernetes-chatgpt-k8sgpt-a9199363dd38) by Vijul Patel 13 | * [ChatGPT for your Kubernetes Cluster — k8sgpt](https://medium.com/techbeatly/chatgpt-for-your-kubernetes-cluster-k8sgpt-649f2cad1bd5) by Renjith Ravindranathan 14 | * [Using the Trivy K8sGPT plugin](https://medium.com/techbeatly/k8sgpt-integration-with-aquasec-trivy-22f53c6730bb) by Renjith Ravindranathan 15 | 16 | ## Videos 17 | 18 | * [Kubernetes + OpenAI = K8sGPT, giving you AI superpowers!](https://youtu.be/7WA8XVrod2Y) 19 | * [k8sgpt Getting Started (2023)](https://youtu.be/yhTS1Dlqygc) 20 | * [Debugging Kubernetes with AI: k8sGPT || AI-Powered Debugging for Kubernetes](https://youtu.be/tgt26P4UmmU) 21 | 22 | ## Contributing 23 | 24 | If you have created any content around K8sGPT, then please add it to this collection. 25 | -------------------------------------------------------------------------------- /docs/reference/cli/serve-mode.md: -------------------------------------------------------------------------------- 1 | # K8sGPT Serve mode 2 | 3 | ## Prerequisites 4 | 5 | 1. Have [grpcurl](https://github.com/fullstorydev/grpcurl) installed 6 | 7 | ## Run `k8sgpt` serve mode 8 | 9 | ```bash 10 | $ k8sgpt serve 11 | {"level":"info","ts":1684309627.113916,"caller":"server/server.go:83","msg":"binding metrics to 8081"} 12 | {"level":"info","ts":1684309627.114198,"caller":"server/server.go:68","msg":"binding api to 8080"} 13 | ``` 14 | 15 | This command starts two servers: 16 | 17 | 1. The health server runs on port 8081 by default and serves metrics and health endpoints. 18 | 2. The API server runs on port 8080 (gRPC) by default and serves the analysis handler. 19 | 20 | For more details about the gRPC implementation, refer to this [link](https://buf.build/k8sgpt-ai/k8sgpt/docs/main). 21 | 22 | ## Analyze your cluster with `grpcurl` 23 | 24 | Make sure you are connected to a Kubernetes cluster: 25 | 26 | ```bash 27 | kubectl get nodes 28 | ``` 29 | 30 | Next, run the following command: 31 | 32 | ```bash 33 | grpcurl -plaintext localhost:8080 schema.v1.ServerService/Analyze 34 | ``` 35 | 36 | This command provides a list of issues in your Kubernetes cluster. If there are no issues identified, you should receive a status of `OK`. 37 | 38 | ## Analyze with parameters 39 | 40 | You can specify parameters using the following command: 41 | 42 | ```bash 43 | grpcurl -plaintext -d '{"explain": false, "filters": ["Ingress"], "namespace": "k8sgpt"}' localhost:8080 schema.v1.ServerService/Analyze 44 | ``` 45 | 46 | In this example, the analyzer will only consider the `k8sgpt` namespace without AI explanation and only focus on the `Ingress` filter. -------------------------------------------------------------------------------- /docs/reference/guidelines/privacy.md: -------------------------------------------------------------------------------- 1 | # Privacy 2 | 3 | K8sGPT is a privacy-first tool and believe transparency is key for you to understand how we use your data. We have created this page to help you understand how we collect, use, share and protect your data. 4 | 5 | ## Data we collect 6 | 7 | K8sGPT will collect data from Analyzers and either display it directly to you or 8 | with the `--explain` flag it will send it to the selected AI backend. 9 | 10 | The type of data collected depends on the Analyzer you are using. For example, the `k8sgpt analyze pod` command will collect the following data: 11 | - Container status message 12 | - Pod name 13 | - Pod namespace 14 | - Event message 15 | 16 | ## Data we share 17 | 18 | As mentioned, K8sGPT will share data with the selected AI backend **only** when you choose 19 | `--explain` and `auth` against that backend. The data shared will be the same as the data collected. 20 | 21 | To learn more about the privacy policy of our default AI backend OpenAI please visit [their privacy policy](https://openai.com/policies/privacy-policy). 22 | 23 | 24 | ## Data we protect 25 | 26 | When you are sending data through the `--explain` option, there is the capability of anonymising some of that data. This is done by using the `--anonymize` flag. In the example of the Deployment Analyzer, this will obfuscate the following data: 27 | 28 | - Deployment name 29 | - Deployment namespace 30 | 31 | ## Data we don't collect 32 | 33 | - Logs 34 | - API Server data other than the primitives used within our Analyzers. 35 | 36 | ### Contact 37 | 38 | If you have any questions about our privacy policy, please [contact us](https://k8sgpt.ai/contact/). 39 | -------------------------------------------------------------------------------- /docs/reference/cli/debugging.md: -------------------------------------------------------------------------------- 1 | # Debugging K8sGPT 2 | 3 | If you are experiencing issues that you believe are related to K8sGPT. 4 | Please cut us an issue [here](https://github.com/k8sgpt-ai/k8sgpt/issues) and upload your K8sGPT dump file. 5 | 6 | To create a K8sGPT dump file run `k8sgpt dump`. 7 | This will create a `dump_