Skip to main content

A conversational AI for Kubernetes users.

Project description

k8sAI

k8sAI is a RAG-enabled GPT that uses a vector store with the embeddings of the Kubernetes documentation. It can answer general questions about Kubernetes, explain output of provided kubectl commands, and suggested commands for you to then easily execute. Given an issue, it can also use kubectl commands to understand the issue and suggest a fix.

k8sAI has a few tools at its disposal that it can call to answer your questions and fix issues:

  • Execute_Kubectl_CMD_Tool - k8sAI can use this to execute kubectl read commands to gather more information about your cluster
  • Suggest_Kubectl_CMD_Tool - k8sAI uses this to suggest a kubectl command to you that you can then edit and execute
  • k8s_search - This tool is used by k8sAI to search k8s documentation to provide informed solutions

Note:

This tool sends data to OpenAI's servers. Please review the OpenAI API terms of use before using this tool. This tool also executes kubectl commands. While they should be read-only commands, unintended consequences are possible. Use the --disable-execution command if you want to be extra-safe.

Installation

Use the package manager pip to install k8sAI.

pip install k8sAI

Configuration

Before using k8sAI, ensure your OpenAI API key is set as an environment variable (OPENAI_API_KEY).

Usage

Chat

To start a conversation with k8sAI:

k8sAI chat [OPTIONS]

Options:

  • -p, --prompt Provide an initial prompt to start the conversation (optional)
  • -t, --terminal Conversation will end after one response (optional)
  • --disable-execution Disable execution of kubectl commands (optional)

Explain

To have k8sAI explain the output of a Kubernetes command:

k8sAI explain --cmd='kubectl [command]' [OPTIONS]

Options:

  • -p, --prompt Provide an additional prompt to go along with the command output (optional)
  • -t, --terminal Conversation will end after one response (optional)
  • --disable-execution Disable execution of kubectl commands (optional)

Note: Only kubectl commands are valid for explanation.

Fix

To request k8sAI to suggest a fix based on a provided description of the problem:

k8sAI fix [OPTIONS]

If no prompt is provided, k8sAI will attempt to discover the problem itself (under development)

Options:

  • -p, --prompt A prompt describing the problem to analyze (optional)
  • -t, --terminal Conversation will end after one response (optional)
  • --disable-execution Disable execution of kubectl commands (optional)

Note: --disable-execution with signficantly reduce k8sAI's ability to discover a problem.

Common Commands

# Start a chat session with k8sAI
k8sAI chat

# Explain the output a specific kubectl command, end chat after first response
k8sAI explain --cmd='kubectl get pods' -t

# Suggest a fix for a described problem
k8sAI fix --prompt='Pods in `default` namespace are crashing frequently'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This code is distributed under the AGPL v3 licensce.

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

k8sai-0.1.6.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

k8sAI-0.1.6-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file k8sai-0.1.6.tar.gz.

File metadata

  • Download URL: k8sai-0.1.6.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for k8sai-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5b47e5402124e8649edbc548a55d9e4a81f615469d0989df630a0002f24828cb
MD5 d68ec9bc6364e36c1bf24e866084271d
BLAKE2b-256 60b3bf1bf23a30a82ceda38f1a2562289ba649dedb58a5fc6076a8fda3b90d8e

See more details on using hashes here.

File details

Details for the file k8sAI-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: k8sAI-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for k8sAI-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 81e3a49cd81854276b5268649062503d831bd5669a62f2a6d4b27f1e5bf62af4
MD5 3642c7f668bdc0c36c8e1351693de30d
BLAKE2b-256 1e97a06a9f3162f9dfb6b7480b97d4080e78ba616bed122ba81f7e2e2961016f

See more details on using hashes here.

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