How kuzmik/proxysql-agent works
Main Components
a) Core Components:
• ProxySQL Agent (Central Component)
• ProxySQL Core Pods
• ProxySQL Satellite Pods
• Kubernetes Integration Points
• HTTP API Server
• Configuration Management
b) External Dependencies:
• MySQL Backend Servers
• Kubernetes API Server
• ProxySQL Admin Interface
┌─ Kubernetes Cluster ──────────────────────────────┐
• ┌─ ProxySQL Core Deployment ─┐ ┌─ Satellite ─┐ │
• ┌─ Pod ─────────────┐ │ │ Deployment │ │
• ProxySQL │ │ │ (Similar │ │
• ProxySQL Agent │ │ │ structure) │ │
• ┘ │ └────────────┘ │
• ┘ │
• ┘
┌─ ProxySQL Agent ───────────────────────┐
• ┌─ Configuration ─┐ ┌─ ProxySQL Core ─┐│
• YAML Config │ │ - Admin API ││
• ENV Vars │ │ - Monitoring ││
• ┘ └────────────────┘ │
• ┌─ REST API ──────┐ ┌─ Health Check ─┐│
• /health │ │ - Liveness ││
• /shutdown │ │ - Readiness ││
• ┘ └────────────────┘ │
• ┘
Key Elements to Highlight
• Blue: Kubernetes components
• Green: ProxySQL components
• Yellow: Agent components
• Gray: External services
b) Connection Types:
Specific Implementation Details
• The agent's connection to ProxySQL admin interface (127.0.0.1:6032)
• Kubernetes service discovery for core/satellite communication
• HTTP API endpoints for health checks and shutdown
• Configuration flow from core to satellite nodes
Important Workflows
• Satellite pod scaling workflow
• Core pod recycling process
• Shutdown sequence
• Health check flow
Technical Specifications
• Go version requirements
• Key dependencies (k8s-client-go, slog, Viper)
• Configuration options
• Port mappings
Notes for Implementation
• Maintain consistent spacing and alignment
• Version information
• Notes for critical points (e.g., "Self-healing cluster management")
• Document failure scenarios and recovery paths
Remember to keep the focus on the agent's role in maintaining the ProxySQL cluster state, especially in the context of Kubernetes pod scaling and lifecycle management.