How tuxmonteiro/galeb works
Project Overview & Main Components
• API Module (“api”): Contains REST controllers, configuration classes, security setups, repositories, and service logic that enable managing configurations, health checks, tokens, and other administrative functions.
• Core Modules (“core” and “newcore”): Hold the domain entities (e.g., Account, Pool, Project, Rule) and business logic of Galeb. They also include common configurations like database and Redis integration.
• Health Module (“health”): Implements services for checking the overall health of the system, including health check endpoints and scheduling components.
• Router Module (“router”): Handles HTTP routing and proxying. It includes clients for load balancing, host selectors, and specific handlers for routing incoming requests.
• Additional Modules (e.g., “kratos”, “legba”): These appear to be additional services – for instance, “kratos” seems to support health or messaging functionality (via JMS) and “legba” deals with aspects like virtual host caching, conversion between API versions, and routing controllers.
• Auxiliary folders and tooling (e.g., Docker configurations, Jenkins pipelines, CI/CD scripts, and Wrapper scripts) that facilitate building, testing, deployment, and monitoring.
Mapping the Interactions and Data Flow
• API service (management and configuration/control interface)
• Core services (domain model and business logic that store and evolve system state)
• Health service (monitoring and self-check mechanisms)
• Router service (actual HTTP load balancing and proxying)
• Supporting services (kratos & legba – possibly handling messaging, authentication, or extended routing capabilities)
• How the API service communicates with the Core services (to update or retrieve load balancing configuration and rules).
• How the Router receives configuration data from the API/Core and then processes incoming HTTP traffic.
• How the Health service periodically checks the state of the other components and might interact with logging and messaging layers.
• Any callback mechanisms—for example, JMS-related configurations in “kratos” indicate asynchronous messaging to communicate health or status changes.
Architectural Patterns and Design Principles
• Microservices/Modular Architecture: Show each module as an independent component (possibly deployed separately), yet interacting via clearly defined interfaces (e.g., REST APIs or messaging endpoints).
• Use of External Configurations: Notice the “confd” directories across modules. These indicate dynamic configuration management. Represent a common configuration service or external config store which feeds configurations into multiple modules.
• Infrastructure as Code / CI-CD: Include a note or an auxiliary block representing build/deployment pipelines (Makefile, Jenkinsfile, .circleci config) that automate packaging (e.g., RPM generation) and testing.
Technological Details and Frameworks
• Technology stack used: Java (as seen in source trees), Maven (pom.xml files), Spring (configuration classes and spring files), and integration with external systems (LDAP for security, JMS for asynchronous messaging, log4j for logging).
• That deployment artifacts are prepared using Makefile targets and Docker (docker-compose.yml in some modules) to ease containerized deployment.
Essential Details
• Components such as:
• Frontend clients (external HTTP clients making requests).
• API / Management Layer (for configuration and monitoring).
• Load Balancing/Router Layer (handling incoming HTTP requests and directing traffic).
• Domain Model/State Management (embedded within the Core modules).
• Health Monitoring and asynchronous messaging channels (JMS queues, scheduled jobs in Health and Kratos).
• It must capture all essential architectural elements – the separation of concerns between management (API), core business logic (Core/newcore), load balancing (Router), and system health (Health, plus interacting services like Kratos and Legba).
• Both the data flow (configuration updates, HTTP traffic handling, and health check communications) and the control flow (how configurations are deployed, how responses are processed).
• Do not be afraid to detail sublayers inside individual modules if needed (e.g., how the API module is broken into controllers, services, and repositories), but ensure that the overall system layout is clear.