diff --git a/README.md b/README.md
index 7fb83a5..b6ce759 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,57 @@
Modern, web-based management interface for HAProxy load balancers with multi-cluster support, agent-based pull architecture, and automated deployment capabilities.
+## π Table of Contents
+
+1. [π― Project Overview](#project-overview)
+ - [Agent Pull Architecture](#agent-pull-architecture)
+ - [Features at a Glance](#features-at-a-glance)
+2. [πΈ Screenshots](#screenshots)
+ - [Dashboard - Real-time Monitoring](#dashboard---real-time-monitoring)
+ - [Multi-Cluster Management](#multi-cluster-management)
+ - [Frontend Management](#frontend-management)
+ - [Configuration Management](#configuration-management)
+ - [Bulk Configuration Import](#bulk-configuration-import)
+ - [Apply Management & Version Control](#apply-management--version-control)
+ - [Agent & Security Management](#agent--security-management)
+3. [Key Capabilities](#key-capabilities)
+ - [Configuration & Entity Management](#configuration--entity-management)
+ - [Agent & Cluster Management](#agent--cluster-management)
+ - [Version Control & Change Management](#version-control--change-management)
+ - [Monitoring & Security](#monitoring--security)
+ - [Integration & API](#integration--api)
+4. [ποΈ Architecture](#architecture)
+ - [System Architecture with Agent Pull Model](#system-architecture-with-agent-pull-model)
+ - [Component Details](#component-details)
+ - [Agent Pull Communication Flow](#agent-pull-communication-flow---detailed-entity-management)
+5. [β¨ Features & User Interface](#features--user-interface)
+ - [Pool Management](#pool-management---agent-pool-organization)
+ - [Agent Management](#agent-management---haproxy-agent-deployment--monitoring)
+ - [Cluster Management](#cluster-management---multi-cluster-haproxy-administration)
+ - [Apply Management](#apply-management---change-tracking--deployment)
+ - [Dashboard](#dashboard---main-overview--real-time-monitoring)
+ - [Frontend Management](#frontend-management---virtual-host--routing-configuration)
+ - [Backend Servers](#backend-servers---server-pool-management)
+ - [SSL Certificates](#ssl-certificates---centralized-tlsssl-certificate-management)
+ - [WAF Management](#waf-management---web-application-firewall)
+ - [Statistics](#statistics---advanced-analytics--reporting)
+ - [Configuration](#configuration---haproxy-config-file-management)
+ - [User Management](#user-management---access-control--authentication)
+ - [Settings](#settings---system-configuration)
+6. [π Getting Started - First-Time Usage](#getting-started---first-time-usage)
+7. [π¦ Installation](#installation)
+ - [Docker Installation](#docker-installation)
+ - [Kubernetes/OpenShift Installation](#kubernetesopenshift-installation)
+ - [Local Development](#local-development)
+8. [π Configuration](#configuration-1)
+9. [π API Reference](#api-reference)
+10. [π Troubleshooting](#troubleshooting)
+11. [π οΈ Development](#development)
+12. [π Contributing](#contributing)
+13. [π License](#license)
+14. [π¨βπ» Author](#author)
+15. [π€ Support](#support)
+
## π― Project Overview
HAProxy OpenManager is a comprehensive management platform designed to simplify HAProxy administration across multiple environments. It provides a unified interface for managing remote HAProxy instances through an agent-based pull architecture, supporting multi-cluster configurations with centralized control.
@@ -33,171 +84,179 @@ Pool (Logical Grouping)
This architecture provides better security (no inbound connections to HAProxy servers), resilience (agents can retry on failure), and scalability (backend doesn't track agent state).
-### Key Capabilities
+### Features at a Glance
-- **Agent-Based Management**: Lightweight agent service for secure, pull-based HAProxy management
-- **Pool Management**: Organize agents into logical pools for better cluster organization
-- **Multi-Cluster Support**: Manage multiple HAProxy clusters from a single interface with cluster selector
-- **Agent Installation Scripts**: Auto-generated platform-specific installation scripts (Linux/macOS)
-- **Configuration Synchronization**: Backends, frontends, SSL certificates, and WAF rules auto-sync to agents
-- **Apply Management**: Centralized change tracking and deployment status monitoring
-- **Real-time Monitoring**: Live statistics, health checks, and performance metrics
-- **Configuration Management**: Visual configuration editor with syntax highlighting and version history
-- **SSL Management**: Centralized certificate management with expiration tracking
-- **WAF Rules**: Web Application Firewall rule management and deployment
-- **User Management**: Role-based access control with admin and user roles
-- **REST API**: Complete API for programmatic access and integration
+β
**Agent-Based Pull Architecture** - Secure, scalable management without inbound connections
+β
**Multi-Cluster & Pool Management** - Organize and manage multiple HAProxy clusters from one interface
+β
**Frontend/Backend/Server CRUD** - Complete entity management with visual UI
+β
**Bulk Config Import** - Import existing `haproxy.cfg` files instantly
+β
**Version Control & Rollback** - Every change versioned with one-click restore capability
+β
**Real-Time Monitoring** - Live stats, health checks, and performance dashboards
+β
**SSL Certificate Management** - Centralized SSL with expiration tracking
+β
**WAF Rules** - Web Application Firewall management and deployment
+β
**Agent Script Versioning** - Update agents via UI (Monaco editor) with auto-upgrade
+β
**Token-Based Agent Auth** - Secure token management with revoke/renew
+β
**Role-Based User Management** - Admin and user roles with granular permissions and access control
+β
**User Activity Audit Logs** - Complete audit trail of all system events
+β
**REST API** - Full programmatic access for automation and CI/CD integration
## πΈ Screenshots
### Dashboard - Real-time Monitoring
-
-*Overview tab showing system metrics, active servers, SSL certificates, and cluster agent health*
-
-*Performance Trends with request rate and response time heatmap (24h view)*
+**Dashboard** - Overview tab showing system metrics, active servers, SSL certificates, and cluster agent health
+
-
-*Health Matrix showing backend servers with detailed health check status and response times*
+**Dashboard** - Performance Trends with request rate and response time heatmap (24h view)
+
-
-*Backends & Servers tab with 165 servers across 56 backends, health status overview*
+**Dashboard** - Health Matrix showing backend servers with detailed health check status and response times
+
+
+**Backend Management** - Backends & Servers tab with 165 servers across 56 backends, health status overview
+
+
+### Multi-Cluster Management
+
+**Multi-Cluster Management** - Cluster selector dropdown showing multiple clusters with agent pools and online agent counts - switch between different clusters
+
+
+### Frontend Management
+
+**Frontend Management** - List view with SSL/TLS bindings, sync status, and config status
+
+
+**Frontend Management** - Edit modal for configuring bind address, protocol mode, default backend, SSL/TLS, ACLs, and advanced options
+
### Configuration Management
-
-*Cluster selector showing multiple clusters with agent pools and online agent counts*
+**Configuration Management** - Backend server and pool configuration page
+
-
-*Frontend Management with SSL/TLS bindings, sync status, and config status*
+**Configuration Management** - Real-time configuration viewer to pull haproxy.cfg from live agents
+
-
-*Backend configuration with TCP mode, health checks, and server management*
+### Bulk Configuration Import
-
-*Real-time configuration viewer - pull haproxy.cfg from live agents*
+**Bulk Config Import** - Paste existing haproxy.cfg and parse configuration
+
+
+**Bulk Config Import** - Parsed entities showing 56 frontends, 55 backends, 165 servers with SSL and configuration recommendations
+
### Apply Management & Version Control
+**Apply Management** - Pending changes and deployment history with version tracking

-*Apply Management showing pending changes and deployment history with version tracking*
-
-*Configuration diff viewer showing added/removed lines with summary*
+**Version History** - Configuration diff viewer showing added/removed lines with summary
+
-
-*Complete version history with restore capabilities and deployment status*
+**Version History** - Complete version history with restore capabilities and deployment status
+
### Agent & Security Management
-
-*Agent setup wizard - platform selection (Linux/macOS) and architecture (x86_64/ARM64)*
+**Agent Management** - Agent setup wizard with platform selection (Linux/macOS) and architecture (x86_64/ARM64)
+
-
-*Generated installation script ready for deployment to target servers*
+**Agent Management** - Generated installation script ready for deployment to target servers
+
+**Security Management** - Agent API token management with active tokens, expiration tracking, and revoke capabilities
+
+
+**WAF Management** - WAF rule configuration with request filtering, rate limiting, and advanced options

-*WAF rule configuration with request filtering, rate limiting, and advanced options*
> π **Note**: Screenshots show the actual production interface. Replace GitHub asset URLs with your own after uploading images to your repository's releases or issues.
+### Key Capabilities
+
+#### Configuration & Entity Management
+- **Frontend Management**: Create, edit, update, and delete frontend configurations with SSL bindings, ACL rules, and routing
+- **Backend Management**: Full CRUD operations for backend pools with load balancing algorithms and health checks
+- **Server Management**: Add, update, remove, and configure backend servers with weights, maintenance mode, and connection limits
+- **Bulk Configuration Import**: Import existing `haproxy.cfg` files to instantly manage all frontends, backends, and servers without manual recreation
+- **Configuration Synchronization**: All entities (backends, frontends, servers, SSL certificates, WAF rules) auto-sync to agents
+- **Configuration Viewer**: View live HAProxy configuration pulled from agents via Configuration Management page
+
+#### Agent & Cluster Management
+- **Agent-Based Management**: Lightweight agent service for secure, pull-based HAProxy management
+- **Pool Management**: Organize agents into logical pools for better cluster organization
+- **Multi-Cluster Support**: Manage multiple HAProxy clusters from a single interface with cluster selector
+- **Agent Token Management**: Secure token-based agent installation with token revoke and renew capabilities
+- **Agent Script Editor**: Monaco code editor for updating agent scripts via UI (not binary) - create new versions, rollback, and auto-upgrade all agents
+- **Platform-Specific Scripts**: Auto-generated installation scripts for Linux and macOS (x86_64/ARM64)
+
+#### Version Control & Change Management
+- **Apply Management**: Centralized change tracking and deployment status monitoring across all agents
+- **Version Control**: Every configuration change creates a versioned snapshot with complete history
+- **Configuration Restore**: Restore any previous configuration version with one-click rollback capability
+- **Diff Visualization**: See exactly what changed between versions with line-by-line comparison
+- **Change Tracking**: Track who made changes, when, and what entities were affected
+
+#### Monitoring & Security
+- **Real-time Monitoring**: Live statistics, health checks, and performance metrics from HAProxy stats socket
+- **SSL Management**: Centralized certificate management with expiration tracking and zero-downtime updates
+- **WAF Rules**: Web Application Firewall rule management and deployment for security protection
+- **User Management**: Role-based access control with admin and user roles
+- **User Activity Logs**: Complete audit trail of all user actions, configuration changes, and system events
+
+#### Integration & API
+- **REST API**: Complete API for programmatic access and integration with CI/CD pipelines
+- **Agent Pull Architecture**: Secure polling model - no inbound connections required to HAProxy servers
+- **Redis Cache**: High-performance metrics caching for dashboard with configurable retention
+
## ποΈ Architecture
### System Architecture with Agent Pull Model
```mermaid
+%%{init: {'theme':'base', 'themeVariables': { 'fontSize':'16px'}}}%%
graph TB
- subgraph USERS[" "]
- USER["π€ HAProxy Manager
(Admin/User)"]
+ subgraph UI_LAYER["π User Interface Layer"]
+ USER["π€ Admin/User"] --> WEB["React UI
Nginx Proxy
:8080"]
end
- subgraph MGMT["π₯οΈ Management Layer"]
- UI["React Frontend
Port: 3000"]
- NGINX["Nginx Proxy
Port: 8080"]
+ subgraph BACKEND_LAYER["βοΈ Backend Layer"]
+ WEB <--> API["FastAPI
Backend
:8000"]
+ API <--> DB[("PostgreSQL
Configs & History")]
+ API <--> CACHE[("Redis
Metrics Cache")]
end
- subgraph BACKEND["βοΈ Backend Services"]
- API["FastAPI Backend
Port: 8000
π Configuration Store
π SSL Management
π‘οΈ WAF Rules"]
- REDIS[("πΎ Redis Cache
Port: 6379
π Metrics Storage")]
- DB[("πΏ PostgreSQL
Port: 5432
ποΈ Clusters, Agents
π Version History")]
- end
-
- subgraph POOL["π¦ Agent Pool: Production"]
- CLUSTER["π― Cluster: Production
(Logical Grouping)"]
+ subgraph AGENT_LAYER["π¦ Agent Pool: Production Cluster"]
+ direction LR
- subgraph HAP1_BOX["π₯οΈ HAProxy Server 1 (10.0.1.101)"]
- AGENT1["π€ Agent
Poll Every 30s"]
- CFG1["π haproxy.cfg"]
- SOCK1["π Stats Socket"]
- SRV1["β‘ HAProxy Service"]
-
- AGENT1 -->|Manages| CFG1
- AGENT1 -->|Reads Stats| SOCK1
- AGENT1 -->|Reload| SRV1
- CFG1 -->|Used by| SRV1
- SRV1 -->|Provides| SOCK1
- end
+ AGENT1["π€ Agent 1
10.0.1.101
(Poll Every 30s)"]
+ AGENT2["π€ Agent 2
10.0.1.102
(Poll Every 30s)"]
+ AGENT3["π€ Agent 3
10.0.1.103
(Poll Every 30s)"]
- subgraph HAP2_BOX["π₯οΈ HAProxy Server 2 (10.0.1.102)"]
- AGENT2["π€ Agent
Poll Every 30s"]
- CFG2["π haproxy.cfg"]
- SOCK2["π Stats Socket"]
- SRV2["β‘ HAProxy Service"]
-
- AGENT2 -->|Manages| CFG2
- AGENT2 -->|Reads Stats| SOCK2
- AGENT2 -->|Reload| SRV2
- CFG2 -->|Used by| SRV2
- SRV2 -->|Provides| SOCK2
- end
+ HAP1["β‘ HAProxy
+ Stats Socket
+ haproxy.cfg"]
+ HAP2["β‘ HAProxy
+ Stats Socket
+ haproxy.cfg"]
+ HAP3["β‘ HAProxy
+ Stats Socket
+ haproxy.cfg"]
- subgraph HAP3_BOX["π₯οΈ HAProxy Server 3 (10.0.1.103)"]
- AGENT3["π€ Agent
Poll Every 30s"]
- CFG3["π haproxy.cfg"]
- SOCK3["π Stats Socket"]
- SRV3["β‘ HAProxy Service"]
-
- AGENT3 -->|Manages| CFG3
- AGENT3 -->|Reads Stats| SOCK3
- AGENT3 -->|Reload| SRV3
- CFG3 -->|Used by| SRV3
- SRV3 -->|Provides| SOCK3
- end
+ AGENT1 --> HAP1
+ AGENT2 --> HAP2
+ AGENT3 --> HAP3
end
- USER -->|Access UI| UI
- UI <-->|HTTP| NGINX
- NGINX <-->|Proxy| API
- NGINX <-->|Serve| UI
+ API <-.->|"π Pull Config
π€ Push Stats
β¬οΈ SSL/WAF"| AGENT1
+ API <-.->|"π Pull Config
π€ Push Stats
β¬οΈ SSL/WAF"| AGENT2
+ API <-.->|"π Pull Config
π€ Push Stats
β¬οΈ SSL/WAF"| AGENT3
- API -->|Store Config| DB
- API -->|Cache Metrics| REDIS
- API <-.->|Version Control| DB
+ classDef uiStyle fill:#3a5a8a,stroke:#6a9eff,stroke-width:3px,color:#fff
+ classDef backendStyle fill:#5a3a8a,stroke:#b39ddb,stroke-width:2px,color:#fff
+ classDef dbStyle fill:#3a6a3a,stroke:#66bb6a,stroke-width:2px,color:#fff
+ classDef agentStyle fill:#8a6a30,stroke:#ffb347,stroke-width:2px,color:#fff
+ classDef haproxyStyle fill:#2a6a5a,stroke:#4db6ac,stroke-width:3px,color:#fff
- CLUSTER -.->|Contains| AGENT1
- CLUSTER -.->|Contains| AGENT2
- CLUSTER -.->|Contains| AGENT3
-
- AGENT1 <-.->|"π Pull Tasks
π€ Upload Stats
β¬οΈ Download SSL"| API
- AGENT2 <-.->|"π Pull Tasks
π€ Upload Stats
β¬οΈ Download SSL"| API
- AGENT3 <-.->|"π Pull Tasks
π€ Upload Stats
β¬οΈ Download SSL"| API
-
- classDef userStyle fill:#bbdefb,stroke:#1565c0,stroke-width:3px,color:#000
- classDef frontendStyle fill:#ce93d8,stroke:#6a1b9a,stroke-width:2px,color:#000
- classDef backendStyle fill:#ffcc80,stroke:#e65100,stroke-width:2px,color:#000
- classDef dbStyle fill:#a5d6a7,stroke:#2e7d32,stroke-width:2px,color:#000
- classDef poolStyle fill:#f8bbd0,stroke:#ad1457,stroke-width:3px,color:#000
- classDef clusterStyle fill:#fff59d,stroke:#f57f17,stroke-width:2px,color:#000
- classDef haproxyStyle fill:#80cbc4,stroke:#00695c,stroke-width:2px,color:#000
- classDef agentStyle fill:#b39ddb,stroke:#4527a0,stroke-width:2px,color:#000
-
- class USER userStyle
- class UI,NGINX frontendStyle
+ class USER,WEB uiStyle
class API backendStyle
- class DB,REDIS dbStyle
- class CLUSTER clusterStyle
- class HAP1_BOX,HAP2_BOX,HAP3_BOX haproxyStyle
+ class DB,CACHE dbStyle
class AGENT1,AGENT2,AGENT3 agentStyle
+ class HAP1,HAP2,HAP3 haproxyStyle
```
### Component Details
@@ -378,10 +437,29 @@ Agent scripts are **not hardcoded** in the project. They are stored in the datab
- **Upgrade Process**: Agents check backend version β Download new script β Self-upgrade β Restart
**Agent Version Update Flow:**
-```
-UI: Edit Script β Create Version 1.0.5 β Mark as Latest
- β Agents Poll β Detect New Version β Self-Download
- β Self-Upgrade β Restart Service
+
+```mermaid
+%%{init: {'theme':'base', 'themeVariables': { 'fontSize':'14px'}}}%%
+graph LR
+ subgraph USER["π€ User Actions"]
+ A["Edit Script
+ Create v1.0.5"] --> B["Mark as
Latest"]
+ end
+
+ subgraph AUTO["π€ Automatic Process"]
+ C["Agents Poll"] --> D["Detect New
Version"] --> E["Download"] --> F["Self-Upgrade"] --> G["β
Running
v1.0.5"]
+ end
+
+ B -.->|Trigger| C
+
+ style USER fill:#2a4a6a,stroke:#4a9eff,stroke-width:2px,color:#fff
+ style AUTO fill:#3a5a3a,stroke:#66bb6a,stroke-width:2px,color:#fff
+ style A fill:#3a5a8a,stroke:#6a9eff,stroke-width:2px,color:#fff
+ style B fill:#3a5a8a,stroke:#6a9eff,stroke-width:2px,color:#fff
+ style C fill:#4a6a4a,stroke:#66bb6a,stroke-width:2px,color:#fff
+ style D fill:#4a6a4a,stroke:#66bb6a,stroke-width:2px,color:#fff
+ style E fill:#4a6a4a,stroke:#66bb6a,stroke-width:2px,color:#fff
+ style F fill:#4a6a4a,stroke:#66bb6a,stroke-width:2px,color:#fff
+ style G fill:#2a5a2a,stroke:#66bb6a,stroke-width:3px,color:#fff
```
#### Agent Operations
@@ -645,137 +723,283 @@ User Updates SSL in UI β All Agents Poll Backend (30s)
- **Language Settings**: Multi-language support configuration
- **Performance Tuning**: System performance and optimization settings
-## π Quick Start - Agent-Based Setup
+## π Getting Started - First-Time Usage
-### Complete Setup Process
+### Quick Start for New Users
-#### Example Scenario: 3-Node HAProxy Cluster
+This guide walks you through using HAProxy OpenManager for the first time, including importing your existing HAProxy configuration.
-Let's set up a production HAProxy cluster with 3 servers (10.0.1.101, 10.0.1.102, 10.0.1.103):
+#### Setup Flow Diagram
-#### Step 1: Create an Agent Pool
-1. Navigate to **Pool Management**
-2. Click **Create Pool**
-3. Fill in details:
- - Name: "Production Pool"
- - Description: "Production environment HAProxy instances"
-4. Save the pool
-
-#### Step 2: Create a Cluster
-1. Go to **Cluster Management**
-2. Click **Create Cluster**
-3. Provide cluster details:
- - Name: "Production Cluster"
- - Description: "3-node production HAProxy cluster"
- - **Select Pool**: "Production Pool" (created in Step 1)
-4. Save the cluster
-5. **Important**: This associates the cluster with the pool
-
-#### Step 3: Create Agents (Repeat for each HAProxy server)
-
-**For HAProxy Server 1 (10.0.1.101):**
-1. Navigate to **Agent Management**
-2. Click **Create Agent**
-3. Fill in agent details:
- - Agent Name: "prod-haproxy-01"
- - Platform: Linux
- - Architecture: x86_64
- - **Select Pool**: "Production Pool" (same pool as cluster!)
-4. Click **Generate Install Script**
-5. Download the script
-
-**Repeat for Server 2 (10.0.1.102):**
- - Agent Name: "prod-haproxy-02"
- - Same Pool: "Production Pool"
-
-**Repeat for Server 3 (10.0.1.103):**
- - Agent Name: "prod-haproxy-03"
- - Same Pool: "Production Pool"
-
-**Result**: You now have 3 agents in "Production Pool", all managing "Production Cluster"
-
-#### Step 4: Install Agents on HAProxy Servers
-
-**On each HAProxy server (10.0.1.101, 102, 103):**
-```bash
-# Copy the downloaded script to the server
-scp install-agent-prod-haproxy-01.sh root@10.0.1.101:/tmp/
-
-# SSH to the server
-ssh root@10.0.1.101
-
-# Make executable and run
-chmod +x /tmp/install-agent-prod-haproxy-01.sh
-sudo /tmp/install-agent-prod-haproxy-01.sh
+```mermaid
+graph TD
+ Start([π Start Setup]) --> Step1[1οΈβ£ Create Agent Pool
HAProxy Agent Pool Management]
+ Step1 --> Step2[2οΈβ£ Create Cluster
HAProxy Cluster Management]
+ Step2 --> Step3[3οΈβ£ Generate Agent Script
Agent Management]
+ Step3 --> Step4[4οΈβ£ Run Script on HAProxy Server
SSH to server and execute]
+ Step4 --> Step5[5οΈβ£ Copy Backup Config
haproxy.cfg.initial-backup]
+ Step5 --> Step6[6οΈβ£ Import Configuration
Bulk HAProxy Config Import]
+ Step6 --> Step7[7οΈβ£ Apply Changes
Apply Management]
+ Step7 --> Complete([β
Setup Complete!])
+
+ style Start fill:#2d5016,stroke:#4caf50,stroke-width:3px,color:#fff
+ style Step1 fill:#7b4d1e,stroke:#ff9800,stroke-width:2px,color:#fff
+ style Step2 fill:#7b4d1e,stroke:#ff9800,stroke-width:2px,color:#fff
+ style Step3 fill:#1a4971,stroke:#2196f3,stroke-width:2px,color:#fff
+ style Step4 fill:#4a1a4a,stroke:#9c27b0,stroke-width:2px,color:#fff
+ style Step5 fill:#6b1e3f,stroke:#e91e63,stroke-width:2px,color:#fff
+ style Step6 fill:#1a4d43,stroke:#009688,stroke-width:2px,color:#fff
+ style Step7 fill:#6b5d1a,stroke:#fbc02d,stroke-width:2px,color:#fff
+ style Complete fill:#2d5016,stroke:#4caf50,stroke-width:3px,color:#fff
```
-The agent will:
-- Install required dependencies (Python, socat)
-- Create `haproxy-agent` systemd service
-- Start polling the backend every 30 seconds
-- Register itself with the backend
-- Begin managing `/etc/haproxy/haproxy.cfg`
+#### Detailed Step-by-Step Instructions
-#### Step 5: Verify All Agents are Connected
-1. Return to **Agent Management** in the UI
-2. You should see all 3 agents:
- - β
prod-haproxy-01 - Connected - Last seen: 5 seconds ago
- - β
prod-haproxy-02 - Connected - Last seen: 3 seconds ago
- - β
prod-haproxy-03 - Connected - Last seen: 8 seconds ago
-3. All agents are now ready to receive configurations
+##### Step 1: Create Agent Pool π¦
-#### Step 6: Configure HAProxy for the Cluster
-1. Select **"Production Cluster"** from the cluster selector at the top
-2. Create **Backends**:
+Navigate to **HAProxy Agent Pool Management** page.
+
+1. Click **"Create Pool"** button
+2. Fill in pool details:
+ - **Pool Name**: `Production Pool` (or your preferred name)
+ - **Description**: `Production environment HAProxy servers`
+3. Click **Save**
+
+**Purpose**: Pools logically group your HAProxy agents for better organization.
+
+---
+
+##### Step 2: Create Cluster π―
+
+Navigate to **HAProxy Cluster Management** page.
+
+1. Click **"Create Cluster"** button
+2. Fill in cluster details:
+ - **Cluster Name**: `Production Cluster`
+ - **Description**: `Main production HAProxy cluster`
+ - **Select Pool**: Choose the pool created in Step 1 (`Production Pool`)
+3. Click **Save**
+
+**Purpose**: A cluster represents a logical grouping of HAProxy configurations that will be deployed to agents.
+
+---
+
+##### Step 3: Generate Agent Installation Script π€
+
+Navigate to **Agent Management** page.
+
+1. Click **"Create Agent"** or **"Generate Script"** button
+2. Configure agent details:
+ - **Agent Name**: `haproxy-prod-01` (unique identifier)
+ - **Select Pool**: Choose the same pool from Step 1 (`Production Pool`)
+ - **Platform**: Select `Linux` or `macOS`
+ - **Architecture**: Select `x86_64` or `ARM64`
+3. Click **"Generate Install Script"**
+4. Click **"Download Script"** to save the installation script
+
+**Purpose**: This generates a customized installation script that will connect your HAProxy server to the management backend.
+
+---
+
+##### Step 4: Install Agent on HAProxy Server π₯οΈ
+
+SSH into your HAProxy server and run the installation script.
+
+```bash
+# Copy the script to your HAProxy server
+scp install-agent-haproxy-prod-01.sh root@your-haproxy-server:/tmp/
+
+# SSH to the HAProxy server
+ssh root@your-haproxy-server
+
+# Make the script executable
+chmod +x /tmp/install-agent-haproxy-prod-01.sh
+
+# Run the installation script
+sudo /tmp/install-agent-haproxy-prod-01.sh
+```
+
+**What the script does:**
+- Installs required dependencies (Python, socat)
+- Creates `haproxy-agent` systemd service
+- Starts the agent (polls backend every 30 seconds)
+- **Creates initial backup**: `/etc/haproxy/haproxy.cfg.initial-backup`
+- Registers the agent with the backend
+
+**Verify installation:**
+```bash
+# Check agent service status
+sudo systemctl status haproxy-agent
+
+# Check agent logs
+sudo tail -f /var/log/haproxy-agent/agent.log
+```
+
+Return to the UI and verify the agent appears in **Agent Management** with status "Connected β
".
+
+---
+
+##### Step 5: Copy Existing HAProxy Configuration π
+
+You have **three options** to get your existing HAProxy configuration:
+
+**Option A: Using the Initial Backup (Recommended)**
+
+On your HAProxy server, the agent created a backup of your original configuration.
+
+```bash
+# Display the backup configuration
+cat /etc/haproxy/haproxy.cfg.initial-backup
+```
+
+**Copy the entire contents** of this file to your clipboard.
+
+---
+
+**Option B: View Configuration via UI (Easiest)**
+
+Navigate to **Configuration Management** page in the UI.
+
+1. Select your agent from the **Agent Selector** dropdown
+2. Click **"View Configuration"** button
+3. The system will fetch the live configuration from the agent
+4. **Copy the entire configuration** displayed in the viewer
+5. You now have the configuration ready for import!
+
+**Benefits**: No need to SSH to the server, get configuration directly from the UI.
+
+---
+
+**Option C: Current Configuration File**
+
+If the backup doesn't exist, SSH to your server and copy the current configuration:
+
+```bash
+# Display current HAProxy configuration
+cat /etc/haproxy/haproxy.cfg
+```
+
+**Copy the entire contents** to your clipboard.
+
+---
+
+##### Step 6: Import Configuration via Bulk Import π₯
+
+Navigate to **Bulk HAProxy Config Import** page.
+
+1. Select your cluster from the **Cluster Selector** dropdown (top of page)
+2. **Paste** the configuration copied from Step 5 into the text area
+3. Click **"Parse Configuration"** button
+4. Review the parsed entities:
+ - Frontends detected
+ - Backends detected
+ - Servers detected
+ - SSL certificates (if any)
+5. Click **"Import Configuration"**
+
+**What happens:**
+- The system parses your HAProxy config file
+- Extracts frontends, backends, servers, and SSL bindings
+- Creates database entities for each component
+- Prepares configuration for deployment
+
+**Result**: Your existing HAProxy configuration is now managed by HAProxy OpenManager! π
+
+---
+
+##### Step 7: Apply Changes to Agent π
+
+Navigate to **Apply Management** page.
+
+1. You'll see pending changes listed:
+ - Frontends to be created
+ - Backends to be created
+ - Servers to be added
+2. Review the changes
+3. Click **"Apply Changes"** button
+4. Monitor deployment status:
```
- Backend: web-backend
- Servers:
- - web01: 192.168.1.10:80
- - web02: 192.168.1.11:80
- - web03: 192.168.1.12:80
- Load Balancing: roundrobin
+ Agent: haproxy-prod-01
+ Status: β
Configuration applied successfully
+ Version: v1.0.1
```
-3. Create **Frontends**:
- ```
- Frontend: web-frontend
- Bind: 0.0.0.0:80
- Default Backend: web-backend
- ```
-4. Upload **SSL Certificates** (if needed)
-5. Add **WAF Rules** (if needed)
-#### Step 7: Apply Changes to All Agents
-1. Navigate to **Apply Management**
-2. You'll see pending changes for "Production Cluster"
-3. Click **Apply Changes**
-4. Watch the deployment status:
- ```
- β
prod-haproxy-01: Configuration applied successfully
- β
prod-haproxy-02: Configuration applied successfully
- β
prod-haproxy-03: Configuration applied successfully
- ```
-5. All 3 HAProxy servers now have identical configurations!
+**What happens:**
+- Backend marks configuration tasks as ready for deployment
+- Agent polls and detects pending tasks (within 30 seconds)
+- Agent downloads the new configuration
+- Agent validates HAProxy configuration syntax
+- Agent reloads HAProxy service (zero downtime)
+- Agent reports success back to backend
-#### Result
-- **1 Pool** ("Production Pool")
-- **1 Cluster** ("Production Cluster")
-- **3 Agents** (prod-haproxy-01, 02, 03)
-- **3 HAProxy Servers** with synchronized configurations
+**Verify deployment:**
+- Check that agent status shows "Applied Successfully"
+- Check HAProxy is running: `systemctl status haproxy`
+- Check HAProxy stats: `http://your-server:8404/stats`
-### π― Traditional Quick Start (for local development/testing)
+---
-For local development without agents:
+#### β
Setup Complete!
-## π Traditional Quick Start
+Your HAProxy server is now fully managed by HAProxy OpenManager. You can now:
-### Prerequisites
+- β¨ **Manage Frontends**: Add, edit, delete frontends via UI
+- π₯οΈ **Manage Backends**: Configure backend servers and health checks
+- π **Upload SSL Certificates**: Centralized SSL management
+- π‘οΈ **Configure WAF Rules**: Add security rules
+- π **Monitor Performance**: View real-time statistics on dashboard
+- π **Version Control**: Track all configuration changes with rollback capability
+
+**Next Steps:**
+- Add more agents to the same pool for multi-node clusters
+- Configure SSL certificates in **SSL Management**
+- Add WAF rules in **WAF Management**
+- Monitor your cluster in **Dashboard**
+
+---
+
+## π¦ Installation
+
+Choose your preferred installation method:
+
+
| + +### π³ Docker Installation +**Recommended for:** +- Quick setup and testing +- Single-server deployment +- Docker Compose environments + +[Jump to Docker Installation β](#docker-installation) + + | ++ +### βΈοΈ Kubernetes/OpenShift Installation +**Recommended for:** +- Production environments +- High availability setup +- Enterprise deployments + +[Jump to Kubernetes Installation β](#kubernetesopenshift-installation) + + | +