sandeep2014/k8s-autopilot

By sandeep2014

•Updated 6 months ago

Multi-agent framework for Kubernetes Helm chart generation and workload management.

Image
Languages & frameworks
Machine learning & AI
Developer tools
0

583

sandeep2014/k8s-autopilot repository overview

GitHub Discord License Python LangGraph

k8s-autopilot is an intelligent, multi-agent framework that automates the complete lifecycle of Kubernetes operations. Built on LangChain and LangGraph, it acts as a unified platform for both Helm Chart Generation (transforming natural language requirements into production-ready charts) and Active Cluster Management (installing, upgrading, and maintaining releases with Human-in-the-loop safety).

ā šŸš€ Quick Start

The easiest way to interact with k8s-autopilot is using the TalkOps Web UI via Docker Compose, which sets up the complete stack including the k8s-autopilot agent, Helm MCP Server, and TalkOps Web UI.

  1. Create a .env file in the project root with your LLM provider API key:

    # Required: LLM Provider API Key
    OPENAI_API_KEY=your_openai_api_key_here
    
    # Optional: Customize LLM models (defaults shown below)
    # LLM_PROVIDER=openai
    # LLM_MODEL=gpt-4o-mini
    # LLM_HIGHER_MODEL=gpt-4o
    # LLM_DEEPAGENT_MODEL=o1-mini
    
  2. Start the services using Docker Compose:

    docker-compose up -d
    

    This will start three services:

    • k8s-autopilot: The main agent (port 10102)
    • helm-mcp-server: Helm operations backend (port 9000)
    • talkops-ui: Web interface (port 8080)
  3. Access the Web UI by opening your browser to:

    http://localhost:8080
    
  4. Start chatting with the agent to create Helm charts, manage releases, or query your cluster:

    Helm Chart Generation:

    Create a Helm chart for nginx
    

    Helm Management (requires Helm MCP Server):

    List all Helm releases in my cluster
    

    or

    Install argo-cd helm chart from this repository - https://argoproj.github.io/argo-helm
    

    The agent will guide you through the process, asking for clarifications if needed, and generate production-ready Helm charts or perform cluster operations via MCP server.

  5. Access generated charts: Charts are saved to ./helm_output directory on your host machine.

ā šŸŽÆ What It Does

k8s-autopilot automates the end-to-end lifecycle of Kubernetes operations, from initial design to active cluster management:

  1. šŸ“‹ Planning: Analyzes requirements, validates completeness, and designs Kubernetes architecture
  2. āš™ļø Generation: Generates Helm templates, values files, and documentation
  3. āœ… Validation: Validates charts, performs security scanning, and ensures production readiness
  4. šŸ“¦ Management: Installs, upgrades, and rolls back releases on active clusters via a dual-path agent
  5. šŸ”„ Self-Healing: Automatically fixes common errors (YAML indentation, deprecated APIs, missing fields)
  6. šŸ‘¤ Human-in-the-Loop: Requests approvals at critical workflow points (Plan, Template, Execution)

⁠✨ Key Features

⁠Current Capabilities

āœ… Fully Supported:

  • Helm chart planning and architecture design
  • Helm chart template generation (Deployment, Service, Ingress, ConfigMap, Secret, HPA, PDB, NetworkPolicy, etc.)
  • Traefik IngressRoute generation (modern CRD-based routing)
  • Helm chart validation (lint, template rendering, cluster compatibility)
  • Self-healing validation errors
  • Human-in-the-loop approvals
  • Active Helm Management: Install, Upgrade, Rollback, Uninstall charts
  • Cluster Discovery: Inspect releases and cluster state
⁠Multi-Agent Architecture
  • Supervisor Agent: Central orchestrator managing workflow phases
  • Planner Agent: Deep agent for requirements analysis and architecture planning
  • Template Coordinator: LangGraph-based coordinator for Helm chart generation
  • Generator Agent: Validator with self-healing capabilities
  • Helm Management Agent: Specialized operational agent for managing Helm releases on active clusters

ā šŸ”§ Configuration

⁠Environment Variables
VariableDescriptionRequired
OPENAI_API_KEYOpenAI API key for LLM providerYes*
A2A_HOSTA2A server host (default: 0.0.0.0)No
A2A_PORTA2A server port (default: 10102)No

* At least one LLM provider API key is required.

⁠Supported LLM Providers

k8s-autopilot supports a wide range of LLM providers including OpenAI, Anthropic, Google Gemini, Azure, and AWS Bedrock. The framework is designed to be provider-agnostic, allowing you to choose the best models for your specific requirements and budget.

Multi-Provider Architecture:

  • Multi-Provider Support: Unified interface for 12+ LLM providers (OpenAI, Anthropic, Azure, Google Gemini, AWS Bedrock, etc.)
  • Model Selection: Configurable model selection per agent via config
  • Hybrid Configuration: Mix providers to use high-reasoning models for Supervisor and faster/cheaper models for Sub-Agents

Example Configuration:

# Supervisor (High Reasoning)
LLM_DEEPAGENT_PROVIDER="openai"
LLM_DEEPAGENT_MODEL="o1-mini"

# Sub-Agents (High Speed/Low Cost)
LLM_PROVIDER="google_genai"
LLM_MODEL="gemini-1.5-flash"

ā šŸ—ļø Architecture

k8s-autopilot follows a hierarchical supervisor-with-swarms pattern, leveraging LangChain's Deep Agents and LangGraph for orchestration.

⁠Architecture Components
  • LangChain Deep Agents: For complex reasoning and planning
  • LangGraph StateGraph: For workflow orchestration
  • Google A2A Protocol: For agent-to-agent communication
  • A2UI (Agent-to-Agent UI): Rich interactive UI components (cards, buttons, forms) for enhanced user experience
  • State Transformation: Seamless state flow between agents
  • Checkpointing: Persistent state management with PostgreSQL or MemorySaver
⁠Workflows

k8s-autopilot supports two primary workflows:

  1. Helm Chart Generation: Creating new charts from scratch (Planning → Generation → Validation)
  2. Helm Management: Managing releases on active clusters via Helm MCP Server (Discovery → Confirmation → Planning → Approval → Execution)

Both workflows include multiple HITL gates for safety and human oversight.

ā šŸ“š Documentation

⁠🐳 Docker Tags

  • latest - Latest stable release
  • v0.2.0 - Current version

ā šŸ’¬ Community & Support

ā šŸ“ License

This project is licensed under the Apache License 2.0 - see the LICENSE⁠ file for details.

ā šŸ™ Acknowledgments

  • LangChain Team: For the excellent LangChain and LangGraph frameworks
  • Google A2A Protocol: For the Agent-to-Agent communication protocol enabling enterprise agent ecosystems
  • CNCF: For Kubernetes and Helm community standards
  • Traefik: For modern ingress routing capabilities

Built with ā¤ļø for the DevOps and Infrastructure community

⭐ Star us on GitHub⁠

Tag summary

Content type

Image

Digest

sha256:f37adf287…

Size

128.5 MB

Last updated

6 months ago

docker pull sandeep2014/k8s-autopilot:v0.3.0