Cluster Code

AI-powered CLI tool for Kubernetes and OpenShift cluster management with intelligent diagnostics, multi-cloud support, and GitOps workflows.

Get Started View on GitHub


What is Cluster Code?

Cluster Code is a comprehensive CLI tool that revolutionizes how you build, maintain, and troubleshoot Kubernetes and OpenShift clusters. Built on Claude’s agentic framework and enhanced with K8sGPT analyzers, it provides:

  • πŸ€– AI-Powered Diagnostics - Intelligent troubleshooting with root cause analysis
  • ☁️ Multi-Cloud Support - Seamless cluster management across AWS, Azure, GCP, and on-premises
  • πŸ”§ GitOps Integration - Automated deployments with Helm, Kustomize, ArgoCD, and Flux
  • πŸš€ Cluster Lifecycle - Create, upgrade, scale, backup, and delete clusters
  • πŸ” Deep Inspection - Advanced diagnostics for pods, services, routes, operators, and more
  • πŸ“Š Local LLM Support - Use self-hosted models for privacy and cost control

Key Features

AI-Powered Cluster Diagnostics

Cluster Code integrates advanced AI capabilities to automatically detect and diagnose cluster issues:

# Run comprehensive cluster diagnostics
cluster-code diagnose

# Analyze specific pod issues
cluster-code analyze pod my-app-pod-xyz

# Troubleshoot OpenShift Routes
cluster-code routes-analyze --namespace production

What it does:

  • Identifies common Kubernetes/OpenShift issues (CrashLoopBackOff, ImagePullBackOff, etc.)
  • Analyzes resource constraints, networking problems, and configuration errors
  • Provides step-by-step remediation instructions
  • Correlates events across resources for root cause analysis

Multi-Cloud Cluster Provisioning

Create production-ready clusters on any cloud platform with best practices built-in:

Azure (AKS & ARO)

# Create Azure Kubernetes Service cluster
cluster-code azure-cluster-create \
  --type aks \
  --name prod-aks \
  --resource-group production-rg \
  --region eastus \
  --nodes 5

# Create Azure Red Hat OpenShift cluster
cluster-code azure-cluster-create \
  --type aro \
  --name prod-aro \
  --resource-group production-rg \
  --region eastus2

AWS (EKS & ROSA)

# Create Elastic Kubernetes Service cluster
cluster-code aws-cluster-create \
  --type eks \
  --name prod-eks \
  --region us-east-1 \
  --nodes 3

# Create Red Hat OpenShift Service on AWS
cluster-code aws-cluster-create \
  --type rosa \
  --name prod-rosa \
  --region us-west-2 \
  --multi-az

GCP (GKE)

# Create Google Kubernetes Engine cluster
cluster-code gcp-cluster-create \
  --name prod-gke \
  --region us-central1 \
  --nodes 4

OpenShift-Specific Features

Enhanced support for OpenShift with specialized commands:

# Analyze Routes for TLS and connectivity issues
cluster-code routes-analyze --namespace production

# Install and manage Operators
cluster-code operator-install --operator openshift-gitops-operator

# Troubleshoot BuildConfigs (coming soon)
cluster-code buildconfig-analyze --namespace ci-cd

OpenShift Features:

  • Routes analysis with certificate expiration checking
  • Operator lifecycle management (install, upgrade, list)
  • BuildConfig and DeploymentConfig support
  • Project management and RBAC configuration

GitOps Workflows

Automate deployments with popular GitOps tools:

Helm Charts

# Deploy with Helm
cluster-code helm-deploy \
  --chart ./my-app-chart \
  --release my-app \
  --namespace production \
  --values prod-values.yaml

Kustomize Overlays

# Apply Kustomize configuration
cluster-code kustomize-apply \
  --path ./overlays/production \
  --wait

ArgoCD Sync

# Synchronize ArgoCD application
cluster-code argocd-sync \
  --app my-production-app \
  --prune

Flux (coming soon)

# Reconcile Flux kustomization
cluster-code flux-reconcile \
  --kustomization my-app-stack

⚑ Quick Start

# 1. Install
npm install -g cluster-code

# 2. Configure LLM Provider
export ANTHROPIC_API_KEY=your-api-key
# or use OpenAI, Google, or local Ollama

# 3. Connect & Go
cluster-code init
cluster-code

That’s it! Start chatting with your cluster in plain English.

View detailed installation guide β†’ Configure LLM providers β†’


Architecture

Cluster Code is built on a modular plugin architecture:

cluster-code/
β”œβ”€β”€ plugins/
β”‚   β”œβ”€β”€ cluster-core/          # Core Kubernetes operations
β”‚   β”œβ”€β”€ k8sgpt-analyzers/      # AI-powered diagnostics
β”‚   β”œβ”€β”€ cloud-azure/           # Azure (AKS/ARO) integration
β”‚   β”œβ”€β”€ cloud-aws/             # AWS (EKS/ROSA) integration
β”‚   β”œβ”€β”€ cloud-gcp/             # GCP (GKE) integration
β”‚   β”œβ”€β”€ cluster-openshift/     # OpenShift-specific features
β”‚   └── gitops/                # GitOps workflows
β”œβ”€β”€ .claude/
β”‚   β”œβ”€β”€ commands/              # Slash commands
β”‚   β”œβ”€β”€ agents/                # Specialized AI agents
β”‚   └── cluster-config.json    # Configuration
└── examples/
    └── cluster-templates/     # Production cluster templates

Key Components:

  • Commands - Markdown-based command definitions with frontmatter
  • Agents - Specialized AI agents for complex operations
  • MCP Servers - Standardized cloud provider integrations
  • Plugins - Modular extensions for different capabilities

Supported Platforms

Kubernetes Distributions

  • βœ… Kubernetes 1.28+ (all distributions)
  • βœ… Azure Kubernetes Service (AKS)
  • βœ… Amazon Elastic Kubernetes Service (EKS)
  • βœ… Google Kubernetes Engine (GKE)
  • βœ… kind, minikube, k3s (local development)

OpenShift

  • βœ… OpenShift 4.15+
  • βœ… Azure Red Hat OpenShift (ARO)
  • βœ… Red Hat OpenShift Service on AWS (ROSA)
  • βœ… OpenShift Local (formerly CodeReady Containers)

Cloud Providers

  • βœ… Azure - Full AKS and ARO support
  • βœ… AWS - Full EKS and ROSA support
  • βœ… GCP - Full GKE support
  • 🚧 On-Premises - Bare metal, VMware, KVM (planned)

Use Cases

For DevOps Engineers

  • Quickly diagnose and fix cluster issues
  • Automate cluster provisioning across clouds
  • Streamline GitOps deployments
  • Monitor cluster health proactively

For SREs (Site Reliability Engineers)

  • Reduce MTTR (Mean Time To Resolution) by 70%
  • Intelligent troubleshooting with AI assistance
  • Comprehensive cluster observability
  • Automated backup and disaster recovery

For Platform Engineers

  • Standardize cluster configurations
  • Multi-cloud cluster management
  • Self-service cluster provisioning
  • Policy enforcement and compliance

For Developers

  • Easy cluster access and context switching
  • Deploy applications with Helm/Kustomize
  • Interactive troubleshooting assistant
  • Local LLM support for privacy

What’s New

Version 1.2.0 (Phase 3) - Latest

New Cloud Providers:

  • ✨ AWS integration (EKS and ROSA)
  • ✨ GCP integration (GKE)

Enhanced GitOps:

  • ✨ ArgoCD synchronization
  • ✨ Flux reconciliation (coming soon)

Cluster Lifecycle:

  • ✨ Cluster deletion with safety checks
  • ✨ Cluster upgrades with validation
  • ✨ Node pool management
  • ✨ Backup and restore workflows

Documentation:

  • πŸ“š Complete GitHub Pages site
  • πŸ“š Comprehensive user guides
  • πŸ“š API reference documentation
  • πŸ“š Step-by-step tutorials

View Full Changelog


Community & Support

Get Help

Contributing

We welcome contributions! See our Contributing Guide.

Stay Updated


License

Cluster Code is open source software licensed under the MIT License.


Next Steps

Ready to get started? Check out our guides:

Or explore the documentation: