Skip to content

Conversation

Copy link

Copilot AI commented Aug 25, 2025

This PR implements the CLI Agent for Azure Kubernetes Service (AKS) as described in the AKS blog post, providing AI-powered operations and diagnostics for AKS clusters.

Overview

The AKS CLI Agent is an intelligent command-line assistant that helps users troubleshoot, optimize, and operate their AKS clusters with AI-driven insights and automated diagnostics. It integrates seamlessly with the Azure CLI as az aks agent and follows the security model outlined in the blog post.

Key Features

🤖 AI-Powered Troubleshooting

  • Natural language query interface supporting questions like "why is my node not ready?" or "diagnose DNS issues"
  • Intelligent query classification for targeted responses (node health, DNS, pod scheduling, cost optimization)
  • Support for multiple AI providers: Azure OpenAI, OpenAI, and Anthropic Claude

🔒 Security & Privacy

  • Local execution: All diagnostics run on the user's machine - no cluster data leaves the client
  • Azure CLI authentication: Inherits existing az login session and RBAC permissions
  • Bring your own AI: Users configure their preferred AI provider (no data retained by Microsoft)

🛠 Comprehensive Diagnostics

  • Node Health: Detect NotReady states, resource pressure, kubelet issues
  • DNS Troubleshooting: Identify CoreDNS problems, resolution failures, network policies
  • Pod Scheduling: Analyze pending pods, resource constraints, affinity issues
  • Cluster Health: Monitor API server, components, and overall cluster status
  • Cost Optimization: Provide recommendations for resource efficiency

Usage Examples

# Basic cluster health check
az aks agent "how is my cluster healthy?"

# Node troubleshooting
az aks agent "why is one of my nodes in NotReady state?"

# DNS diagnostics
az aks agent "why are my pods failing DNS lookups?"

# Pod scheduling issues
az aks agent "why is my pod stuck in Pending state?"

# Cost optimization
az aks agent "how can I optimize the cost of my cluster?"

# Check agent status
az aks agent status

# Interactive configuration
az aks agent configure

Architecture

The implementation follows a modular design built on open-source foundations:

  • Core Agent Engine: Python-based with extensible AI provider abstraction
  • Azure Integration: Native Azure SDK integration with proper authentication
  • Kubernetes Client: Direct cluster API access for real-time diagnostics
  • Diagnostics Engine: Comprehensive kubectl-based analysis tools
  • Configuration Management: YAML-based config with environment variable support

Installation Options

  1. Quick Demo: Run ./az-aks-agent.sh --help for immediate testing
  2. Python Package: Install with pip install -e cli-agent/
  3. Azure CLI Integration: Shell alias or proper extension packaging
  4. Direct Usage: python -m aks_agent.cli

Files Added

  • cli-agent/: Complete Python package implementation
  • az-aks-agent.sh: Azure CLI integration script with demo mode
  • cli-agent/README.md: Comprehensive usage documentation
  • cli-agent/INSTALLATION.md: Installation guide for different deployment scenarios
  • cli-agent/examples/: Configuration templates and usage examples
  • cli-agent/tests/: Unit tests for core functionality

This implementation provides the foundation described in the AKS CLI Agent blog post, enabling users to leverage AI-powered assistance for complex Kubernetes troubleshooting scenarios while maintaining security and privacy through local execution.

Fixes #5232.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] CLI Agent for AKS Implement CLI Agent for AKS with AI-powered troubleshooting capabilities Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agentic CLI for AKS

2 participants