Introduction
The application is designed as a distributed microservices-based system intended for deployment in a Kubernetes environment. The architecture emphasizes the scalability of the backend logic and the separation of concerns between the user interface, data processing, and visualization. The system is deployed within the anomgrd namespace.
1. Component Overview
The system consists of three main logical units: Frontend, Backend Cluster, and Streamlit. Container images are pulled from the private Azure Container Registry (acranomalyguard.azurecr.io).
1.1 Frontend
The Frontend serves as the entry point for users.
- Service: Named
frontend, runs on port 80. - Scaling: Currently set to 1 replica.
- Resources: Requests 250m CPU and 256Mi RAM.
- Limits: Limited to 500m CPU and 512Mi RAM.
1.2 Backend (Master-Slave Architecture)
The Backend utilizes a Master-Worker pattern to effectively distribute the load, separating control logic from computational logic. Database connection is handled securely via a Kubernetes Secret named anomalyguard-db.
Master Node (Control Node)
The Master serves as the main API endpoint and task orchestrator.
- Identification: Acts as
master_node_1withnodeType: "master". - Task Parameters: Processes 50 jobs (
masterNodeJobCount) with a maximum parallelism of 3 (maxParallelJobs). - Resources: Requests 500m CPU and 256Mi RAM.
- Limits: Limited to 1 CPU and 512Mi RAM.
Slave Nodes (Worker Nodes)
These nodes are designated for data processing and running heavy background tasks.
- Flexibility & Scaling: The number of slave nodes is configurable based on the current workload. The default configuration launches 3 replicas, which can be scaled horizontally.
- Identification: Configured as
nodeType: "child". - Task Parameters: Optimized for a high volume of tasks (200 jobs per node) with higher parallelism (5 parallel jobs).
- Limits: Limited to 500m CPU and 512Mi RAM.
1.3 Streamlit (Visualization)
The component used for advanced analytics and data visualization.
- Scaling: 1 replica.
- API Communication: Connects to the Backend Master node via the environment variable
API_URL: "http://backend-master/api". - Service: Named
streamlit, runs on port 8000.
2. Network Architecture & Routing
Application ingress is managed by an NGINX Ingress Controller. This allows unified access to all services.
Path Mapping (Ingress Routes)
| Component | Path | Service Name | Service Port |
|---|---|---|---|
| Frontend | / |
frontend |
80 |
| Backend Master | /api |
backend-master |
80 |
| Streamlit | /view |
streamlit |
8000 |
Ingress for the Frontend/Backend is enabled (enabled: true). Streamlit has its own Ingress, which is also enabled (enabled: true).