Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.6 KB

README.md

File metadata and controls

65 lines (45 loc) · 1.6 KB

🤖 Kubernetes AI Agent

This module provides REST API to invoke kubernetes agent that uses MCP tools to manage your Kubernetes cluster.

For useful prompts, checkout the main README.md

✨ Overview

The Agent module is a Spring Boot application that:

  • Processes natural language queries about Kubernetes
  • Integrates with OpenAI for intelligent responses
  • Provides a REST API endpoint for chat interactions
  • Formats responses in HTML for easy reading

🎁 Features

  • 🧠 Natural language understanding of Kubernetes concepts
  • 🔄 Integration with Kubernetes API for real-time data
  • 📝 HTML formatting for structured responses
  • 🔌 REST API for easy integration with frontends

🏗️ 1. Project Build

# From the agent directory
mvn clean package

🚀 2. Running the Agent

# Run the agent directly (includes all dependencies)
export OPENAI_API_KEY=your_api_key
java -jar target/agent-*-fat.jar

The server will start on port 8080 by default, and you can access the chat API at:

http://localhost:8080/api/v1/chat

🤝 3. API Usage

The agent exposes a simple REST API for chat interactions:

curl -X POST http://localhost:8080/api/v1/chat -H "Content-Type: text/plain" -d "What pods are running in the default namespace?"

Note: The response will be HTML-formatted text.

🔧 4. Configuration

The agent can be configured through application.properties:

# Server configuration
server.port=8080

# Spring AI configuration
spring.ai.openai.api-key=${OPENAI_API_KEY}
spring.ai.openai.chat.options.model=gpt-4o-mini