Skip to content

KubeStack-AI: A unified, AI-powered command-line assistant for diagnosing, managing, and optimizing the entire middleware stack running on Kubernetes and bare-metal environments.

License

Notifications You must be signed in to change notification settings

turtacn/kubestack-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KubeStack-AI

KubeStack-AI Logo

AI-Powered Unified Middleware Management for Kubernetes & Beyond

Build Status License Release Go Report Card Coverage

δΈ­ζ–‡ζ–‡ζ‘£ β€’ Architecture β€’ Contributing β€’ Plugin Development


πŸš€ Mission Statement

KubeStack-AI is a revolutionary, AI-powered command-line assistant that transforms how you diagnose, manage, and optimize your entire middleware stack running on Kubernetes and bare-metal environments. By combining the power of Large Language Models with deep middleware expertise, KubeStack-AI provides intelligent, natural language-driven operations for complex cloud-native infrastructures.

🎯 Why KubeStack-AI?

The Challenge

Modern cloud-native environments involve dozens of middleware components (Redis, Kafka, PostgreSQL, MinIO, ElasticSearch, etc.), each with unique operational complexities. Traditional approaches require:

  • Fragmented Tools: Different CLI tools for each middleware
  • Deep Expertise: Extensive knowledge of each system's internals
  • Manual Correlation: Connecting symptoms across multiple systems
  • Time-Consuming Diagnosis: Hours spent troubleshooting complex issues

Our Solution

KubeStack-AI provides a unified, AI-driven interface that:

βœ… Speaks Your Language: Natural language queries instead of complex commands
βœ… Thinks Holistically: Cross-middleware correlation and root cause analysis
βœ… Acts Intelligently: AI-powered diagnosis with actionable recommendations
βœ… Extends Seamlessly: Plugin architecture for any middleware
βœ… Operates Safely: Interactive confirmation for critical operations

⭐ Key Features

πŸ” Intelligent Diagnosis

  • Multi-Layer Analysis: System, Kubernetes, and middleware-specific checks
  • AI-Powered RCA: Root cause analysis across complex distributed systems
  • Natural Language Queries: Ask questions in plain English

πŸ› οΈ Universal Middleware Support

  • Database Systems: MySQL, PostgreSQL, MongoDB, Redis, ClickHouse
  • Message Queues: Kafka, RabbitMQ, Pulsar
  • Search & Analytics: ElasticSearch, OpenSearch
  • Storage: MinIO, Ceph
  • Monitoring: Prometheus, Grafana
  • Service Discovery: etcd, Consul

🧩 Plugin Architecture

  • Extensible Design: Add support for any middleware through plugins
  • Community Driven: Open plugin ecosystem
  • Hot-swappable: Install, update, and remove plugins without downtime

πŸ€– AI-Enhanced Operations

  • Smart Recommendations: Context-aware optimization suggestions
  • Automated Fixes: One-click resolution for common issues
  • Knowledge Integration: Built-in best practices and troubleshooting guides

πŸš€ Getting Started

Installation

Option 1: Go Install

go install github.com/turtacn/kubestack-ai/cmd/ksa@latest

Option 2: Homebrew (macOS/Linux)

brew tap turtacn/kubestack-ai
brew install kubestack-ai

Option 3: Download Binary

Visit our releases page to download pre-built binaries.

Quick Start

# Initialize KubeStack-AI
ksa init

# Diagnose all middleware in current namespace
ksa diagnose --all

# Ask natural language questions
ksa ask "Why is my Redis cluster slow?"

# Get specific middleware status
ksa status redis --namespace production

# List available plugins
ksa plugin list

# Install a new plugin
ksa plugin install mongodb

Basic Usage Examples

Example 1: Comprehensive System Health Check

$ ksa diagnose --middleware redis,mysql,kafka
πŸ” Analyzing Redis cluster...
βœ… Redis: Healthy (3/3 nodes up, memory usage: 45%)

πŸ” Analyzing MySQL primary-replica...
⚠️  MySQL: Warning detected
   β€’ Replica lag: 2.3s (threshold: 1s)
   β€’ Slow queries: 23 in last hour

πŸ” Analyzing Kafka cluster...
❌ Kafka: Critical issues found
   β€’ Topic 'orders': 50K messages backed up
   β€’ Consumer group 'payment-service': 5min lag

πŸ’‘ AI Recommendations:
   1. MySQL: Consider tuning innodb_buffer_pool_size
   2. Kafka: Scale consumer group or check processing logic

Example 2: Natural Language Troubleshooting

$ ksa ask "My application can't connect to the database"
πŸ€” Analyzing connection issues...

πŸ” Discovered Issues:
   β€’ PostgreSQL max_connections (100) reached
   β€’ Connection pool exhaustion in app pods
   β€’ Network policy blocking traffic on port 5432

πŸ› οΈ  Suggested Actions:
   1. Increase max_connections: `ksa exec postgres --set max_connections=200`
   2. Scale app replicas: `ksa scale app --replicas 5`
   3. Review network policies: `ksa network analyze postgres`

Execute fixes? [y/N]: 

Example 3: Plugin Management

$ ksa plugin install clickhouse
πŸ“¦ Installing ClickHouse plugin v1.2.0...
βœ… Plugin installed successfully

$ ksa diagnose clickhouse --cluster analytics
πŸ” ClickHouse Cluster Analysis:
   β€’ Merge queue: 145 items (high)
   β€’ Query latency P95: 2.3s
   β€’ Disk usage: 78% on shard-2

πŸ’‘ Recommendations:
   β€’ Consider adding more background merge threads
   β€’ Archive old partitions in 'events' table

πŸ“– Documentation

πŸ—οΈ Codebase Structure

A brief overview of the key directories in the KubeStack-AI repository:

  • /cmd: Main application entry points. The ksa CLI application lives here.
  • /internal: All of the core application logic. As this is an internal package, it is not meant to be imported by external applications.
    • /cli: Defines the command-line interface using Cobra, including command definitions, flag parsing, and UI formatters.
    • /core: The heart of the application. It contains the central orchestrator and the primary interfaces for diagnosis, execution, and plugins.
    • /llm: Abstractions and clients for interacting with Large Language Models (LLMs) and the Retrieval-Augmented Generation (RAG) pipeline.
    • /knowledge: Components for the knowledge base, including storage, crawling, and search functionalities.
    • /plugins: The plugin management system and all built-in middleware plugins (e.g., Redis, Kafka).
  • /pkg: Shared utility packages that could theoretically be used by external applications.
  • /deployments: Kubernetes manifests, Dockerfiles, and other deployment-related artifacts.
  • /docs: Project documentation, including architecture and contribution guides.
  • /scripts: Helper scripts for development tasks like building, testing, and linting.
  • /web: Contains frontend assets for a potential web-based UI.

🀝 Contributing

We welcome contributions from the community! KubeStack-AI is built by middleware experts for middleware experts.

How to Contribute

  1. πŸ› Report Issues: Found a bug? Open an issue
  2. πŸ’‘ Feature Requests: Have ideas? Start a discussion
  3. πŸ”§ Code Contributions: Fork, develop, and submit PRs
  4. πŸ“ Documentation: Help improve our docs
  5. 🧩 Plugin Development: Build plugins for new middleware

Development Setup

git clone https://github.com/turtacn/kubestack-ai.git
cd kubestack-ai
make dev-setup
make test
make build

See CONTRIBUTING.md for detailed guidelines.

πŸ† Community & Support

πŸ“œ License

KubeStack-AI is licensed under the Apache License 2.0. See LICENSE file for details.

🌟 Star History

Star History Chart


Built with ❀️ by the KubeStack-AI community

About

KubeStack-AI: A unified, AI-powered command-line assistant for diagnosing, managing, and optimizing the entire middleware stack running on Kubernetes and bare-metal environments.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages