How sashi-u/multi-juicer works
Project Type and Purpose
• MultiJuicer is a Kubernetes-based orchestration platform (“full-stack,” microservices style)
• Purpose: Dynamically spin up per-team OWASP Juice Shop instances on a central cluster, route traffic, persist progress, and garbage-collect idle instances.
File Structure
Top-level microservice folders:
– cleaner (Node.js cronjob)
– juice-balancer (Node.js load-balancer + UI)
– progress-watchdog (Go service)
Packaging & deployment:
– helm/multi-juicer: Helm chart with Kubernetes manifests (Deployments, Services, ConfigMaps, CronJobs)
– guides/: Cloud-provider setup tutorials
– e2e/: Cypress end-to-end tests
README for Architecture Insights
• Describes requirements for a custom load-balancer, backup/restore, and cleanup
A. Main Components
1. External Clients (Participants)
2. Kubernetes Cluster
a. Ingress/LoadBalancer (NGINX or cloud LB)
b. juice-balancer Service
– Node.js application (proxy logic + Kubernetes API client + Redis client)
– React UI served at /admin and join pages
c. Redis (in-cluster) – session/cookie store, mapping of users → team deployments
d. progress-watchdog Deployment (Go) – watches Juice Shop pods, backs up/restores progress
e. cleaner CronJob (Node) – scheduled cleanup of old/idle Juice Shop deployments
f. Per-team Juice Shop Deployments (one Deployment + Service per team)
g. ConfigMaps & Secrets (helm values.yaml drives configs)
B. Relationships & Data Flow
1. Client → DNS → Ingress → juice-balancer
2. juice-balancer reads incoming request cookie → looks up mapping in Redis
3. If no mapping, juice-balancer uses Kubernetes API → create new Juice Shop Deployment & Service
4. juice-balancer proxies HTTP traffic into the correct Juice Shop Service
5. progress-watchdog polls Kubernetes API and/or container file system → periodically snapshot challenge progress (e.g., to persistent volume or object store)
6. On Juice Shop restart, progress-watchdog restores state from backups
7. cleaner CronJob runs on schedule → queries Kubernetes API for stale deployments → deletes them
C. Architectural Patterns & Principles
• Microservices within a single Kubernetes cluster
• “Control plane” (juice-balancer + progress-watchdog + cleaner) separate from “data plane” (Juice Shop instances)
• Event-driven resource management via Kubernetes API calls
• Helm for packaging and templating infrastructure as code
D. Key Technologies
• Kubernetes (Deployments, Services, Ingress, CronJob)
• Helm (templating, values.yaml)
• Node.js (juice-balancer & cleaner)
• React (juice-balancer UI)
• Go (progress-watchdog)
• Redis (stateful session store)
• Cypress (e2e testing)