How redhat-cop/babylon works
Project type and purpose
• Babylon is a Kubernetes-native, multi-service suite deployed on OpenShift. It consists of several custom controllers (“operators”), RESTful microservices, and front-end UIs.
• Its goal is to manage catalogs, workshops, sandboxes, incident tracking, cost reporting, ratings, and lab UIs via CRDs and microservices.
File structure
• Top-level folders:
• admin, catalog, ratings → each is a REST API service (Python + FastAPI/Flask) with its own database models, routers, schemas, and Docker/S2I build files.
• catalog/ui → React/TypeScript front-end served by Nginx.
• agnosticv-operator, catalog-manager, workshop-manager, cost-tracker, lab-ui-manager, notifier → each implements a Python/Kopf operator under operator/ and has a Helm chart under helm/.
• helm/ + openshift/config/ → umbrella Helm chart and environment-specific overrides.
• playbooks/ and tools/ → Ansible automation scripts for initial setup.
README for additional insights
• It confirms a Helm-driven deployment and ties back to multiple GitHub repos.
a. Main components (grouped by layer)
• Control Plane
– Kubernetes API Server & CRDs (from top-level helm/crds)
– Operators (each watching specific CRDs):
· AgnosticV Operator
· Catalog Manager Operator
· Workshop Manager Operator
· Cost-Tracker Operator
· Lab-UI Manager Operator
· Notifier Operator
• Data Plane
– Microservices: admin/api, catalog/api, ratings/api
– UIs: Catalog React App, Status Page
• Data Stores
– PostgreSQL (per-service databases; database-secrets.yaml)
– Redis (Notifier queue)
• External Services
– Salesforce API (catalog integrations)
– SMTP server (Notifier)
– OpenShift OAuth Proxy (authentication)
b. Relationships & interactions
• Operators ←── watch CRD events via K8s API → reconcile → create/update K8s resources (Deployments, Secrets, ConfigMaps).
• Helm umbrella chart ←── CI/CD pipelines (GitHub Actions & GitLab CI) → deploy subcharts (operators + microservices + CRDs).
• React UI −−HTTP/S→ OAuth Proxy −−> Kubernetes Service −−> catalog/api, admin/api, ratings/api
• Microservices −−SQL→ PostgreSQL; optionally −−Redis Pub/Sub→ Redis
• Notifier Operator −−listens to CR events→ enqueues messages in Redis −−> SMTP server
c. Architectural patterns & design principles
• Operator Pattern (Kopf + CRDs) for declarative control loops
• Microservices per bounded context
• Event-driven reconciliation vs synchronous HTTP/API calls
• Separation of control-plane (operators) vs data-plane (UIs + APIs)
• Helm-based packaging and GitOps-style CI
d. Key technologies & frameworks
• Python + Kopf for operators
• FastAPI/Flask + Pydantic for REST APIs
• React + Redux for front-end
• PostgreSQL + SQLAlchemy
• Redis for message queuing
• Helm for packaging & templating
• OpenShift S2I or Containerfile for builds
• Ansible playbooks for OpenShift setup