Skip to main content

spc--webapp

Overview

  • Namespace: spc--webapp
  • Purpose: Sapoche Web Applications - PRODUCTION
  • Age: ~2 years 356 days (since November 2022)
  • Status: Active - Frontend web applications with micro-frontend architecture
  • Workloads: 7 deployments (all at 1 replica) - No HA
  • Environment: PRODUCTION - Sapoche-facing web frontends

Architecture

Sapoche web application frontends served via NGINX with micro-frontend architecture:

  • 7 Micro-Frontends: All at 1 replica each - No redundancy
    • Appointment micro-frontend
    • Delivery micro-frontend
    • LIS micro-frontend (very active)
    • Promotion BFF and micro-frontend
    • Purchase order micro-frontend (very active)
    • Booking micro-frontend

Auto-Scaling Configuration

No Auto-Scaling Configured:

  • No HorizontalPodAutoscalers (HPAs)
  • No KEDA scaled objects
  • Fixed 1 replica for all deployments

Workload Categories

Frontend Applications (7 deployments - ALL at 1 replica)

NameReplicasStatusPurpose
sapoche-micro-appointment--nginx1/1RunningAppointment micro-frontend
sapoche-micro-delivery--nginx1/1RunningDelivery micro-frontend
sapoche-micro-lis--nginx1/1RunningLIS micro-frontend - Very active (2d20h)
sapoche-micro-promotion--bff1/1RunningPromotion BFF service
sapoche-micro-promotion--nginx1/1RunningPromotion micro-frontend
sapoche-micro-purchase-order--nginx1/1RunningPurchase order micro-frontend - Very active (44h)
spc--booking-micro--fe--nginx1/1RunningBooking micro-frontend

Services

NameTypeCluster IPPortsNodePortPurpose
sapoche-micro-appointment--nginx--prodNodePort10.8.31.1148031457Appointment micro-frontend
sapoche-micro-delivery--nginx--prodNodePort10.8.26.1558030829Delivery micro-frontend
sapoche-micro-lis--nginx--prodNodePort10.8.25.1668031037LIS micro-frontend
sapoche-micro-promotion--bff--prodNodePort10.8.31.82300232493Promotion BFF
sapoche-micro-promotion--nginx--prodNodePort10.8.26.738032586Promotion micro-frontend
sapoche-micro-purchase-order--nginx--prodNodePort10.8.21.1778030578Purchase order micro-frontend
spc--booking-micro--fe--nginx--prodNodePort10.8.30.2198031339Booking micro-frontend

Access & Management

View all resources:

kubectl get all -n spc--webapp

Check frontend applications:

# Appointment micro-frontend
kubectl logs -f deployment/sapoche-micro-appointment--nginx--prod -n spc--webapp

# Delivery micro-frontend
kubectl logs -f deployment/sapoche-micro-delivery--nginx--prod -n spc--webapp

# LIS micro-frontend (very active)
kubectl logs -f deployment/sapoche-micro-lis--nginx--prod -n spc--webapp

# Promotion BFF
kubectl logs -f deployment/sapoche-micro-promotion--bff--prod -n spc--webapp

# Promotion micro-frontend
kubectl logs -f deployment/sapoche-micro-promotion--nginx--prod -n spc--webapp

# Purchase order micro-frontend (very active)
kubectl logs -f deployment/sapoche-micro-purchase-order--nginx--prod -n spc--webapp

# Booking micro-frontend
kubectl logs -f deployment/spc--booking-micro--fe--nginx--prod -n spc--webapp

Restart services:

# Restart specific micro-frontend
kubectl rollout restart deployment/sapoche-micro-lis--nginx--prod -n spc--webapp

# Restart all
kubectl rollout restart deployment --all -n spc--webapp

Access applications:

# Port forward LIS micro-frontend
kubectl port-forward -n spc--webapp service/sapoche-micro-lis--nginx--prod 8080:80
# Access http://localhost:8080

# Port forward promotion BFF
kubectl port-forward -n spc--webapp service/sapoche-micro-promotion--bff--prod 8081:3002
# Access http://localhost:8081

Monitoring

Resource usage:

kubectl top pods -n spc--webapp --sort-by=memory
kubectl top pods -n spc--webapp --sort-by=cpu

Events:

kubectl get events -n spc--webapp --sort-by='.lastTimestamp' | head -20

Application Flow

Sapoche User Browser Request

Load Balancer / Ingress

NGINX Micro-Frontend Services (1 replica each)
├─ Appointment → sapoche-micro-appointment--nginx (NodePort 31457)
├─ Delivery → sapoche-micro-delivery--nginx (NodePort 30829)
├─ LIS → sapoche-micro-lis--nginx (NodePort 31037)
├─ Promotion → sapoche-micro-promotion--nginx (NodePort 32586)
│ ├─ BFF → sapoche-micro-promotion--bff (NodePort 32493)
├─ Purchase Order → sapoche-micro-purchase-order--nginx (NodePort 30578)
└─ Booking → spc--booking-micro--fe--nginx (NodePort 31339)

Static Assets Served (HTML, JS, CSS)

Browser API Calls → Backend Services

Sapoche Portal Applications

1. Appointment Micro-Frontend

  • NGINX frontend with 1 replica - No HA
  • Appointment scheduling interface
  • Calendar views
  • Appointment management
  • Updated 28 days ago (stable)

2. Delivery Micro-Frontend

  • NGINX frontend with 1 replica - No HA
  • Delivery tracking interface
  • Sample delivery management
  • Route planning
  • Updated 66 days ago (stable)

3. LIS Micro-Frontend (Very Active)

  • NGINX frontend with 1 replica - No HA
  • Laboratory Information System interface
  • Test result entry and viewing
  • Sample tracking
  • Most active: Updated 2 days 20 hours ago

4. Promotion BFF + Micro-Frontend

  • BFF service (Backend For Frontend) with 1 replica
  • NGINX frontend with 1 replica - No HA
  • Promotion campaign management UI
  • Discount configuration interface
  • Both updated 6 days 20 hours ago (active)

5. Purchase Order Micro-Frontend (Very Active)

  • NGINX frontend with 1 replica - No HA
  • Purchase order creation and management
  • Supplier management
  • Order tracking
  • Very active: Updated 44 hours ago

6. Booking Micro-Frontend

  • NGINX frontend with 1 replica - No HA
  • Booking management interface
  • Slot management
  • Booking calendar
  • Updated 82 days ago (stable)

Production Considerations

High Availability

NO HIGH AVAILABILITY:

  • All 7 frontends at 1 replica - complete lack of redundancy
  • Any pod failure = service outage
  • Critical patient-facing applications with no HA
  • Very mature namespace (~3 years) but no HA configuration

Recommendations

  1. URGENT: Add Frontend Resilience:

    • All frontends at 1 replica (critical issue)
    • Increase ALL to 2+ replicas immediately
    • Critical Sapoche-facing applications
    • NGINX can handle high concurrency but needs redundancy
    • Priority: LIS and Purchase Order (most active)
  2. Add Auto-Scaling:

    • Consider HPA for all frontends
    • Scale based on CPU/Memory
    • Target: 2-5 replicas based on traffic
    • Static content scales well horizontally
  3. Micro-Frontend Strategy:

    • Good separation by feature
    • Each feature deployed independently
    • Different update frequencies (LIS: 2d20h vs Booking: 82d)
    • Allows targeted scaling and updates
    • BUT all at 1 replica (no redundancy)
  4. Update Patterns:

    • sapoche-micro-purchase-order: Very active (44 hours ago)
    • sapoche-micro-lis: Very active (2 days 20 hours ago)
    • sapoche-micro-promotion (BFF + FE): Active (6 days 20 hours ago)
    • sapoche-micro-appointment: Stable (28 days ago)
    • sapoche-micro-delivery: Stable (66 days ago)
    • spc--booking-micro: Stable (82 days ago)
  5. Monitoring Priorities:

    • Response times per micro-frontend
    • Error rates (4xx, 5xx) per service
    • Static asset delivery performance
    • Traffic patterns by feature
    • Pod restart counts (1 replica = no fallback)

Troubleshooting

Micro-frontend issues:

# Check specific micro-frontend
kubectl get pods -n spc--webapp | grep lis

# Check NGINX logs
kubectl logs -f deployment/sapoche-micro-lis--nginx--prod -n spc--webapp

# Check for errors
kubectl logs deployment/sapoche-micro-lis--nginx--prod -n spc--webapp --tail=100 | grep -i "error\|fail"

# Test locally
kubectl port-forward -n spc--webapp service/sapoche-micro-lis--nginx--prod 8080:80
curl http://localhost:8080

Static asset issues:

# Check if assets are being served
kubectl exec -it deployment/sapoche-micro-lis--nginx--prod -n spc--webapp -- ls -la /usr/share/nginx/html

# Check NGINX access logs
kubectl logs deployment/sapoche-micro-lis--nginx--prod -n spc--webapp | grep -v "kube-probe"

# Restart to clear any caching issues
kubectl rollout restart deployment/sapoche-micro-lis--nginx--prod -n spc--webapp

Performance issues:

# Check resource usage
kubectl top pods -n spc--webapp

# Check NGINX worker processes
kubectl exec -it deployment/sapoche-micro-lis--nginx--prod -n spc--webapp -- ps aux | grep nginx

# Check connections per micro-frontend
for deploy in $(kubectl get deployments -n spc--webapp -o name); do
echo "=== $deploy ==="
kubectl exec -it $deploy -n spc--webapp -- netstat -an | grep ESTABLISHED | wc -l 2>/dev/null || echo "N/A"
done

Performance Metrics

Current Scale

  • All Micro-Frontends: 1 replica each - NO HA
  • Total Active Pods: 7 pods (0 redundancy)

Stability

  • Namespace Age: ~3 years (very mature)
  • Most Active: sapoche-micro-purchase-order (44 hours ago)
  • Most Active: sapoche-micro-lis (2 days 20 hours ago)
  • Architecture: Good micro-frontend pattern
  • High Availability: CRITICAL ISSUE - All at 1 replica

Architecture Notes

  • Micro-Frontend Pattern: Good separation by feature
  • NGINX: Static asset serving, efficient and scalable
  • No Backend Logic: Pure frontend deployments
  • API Calls: Frontend calls backend services directly
  • Independent Deployment: Each feature can be updated separately
  • Independent Scaling: Each micro-frontend could be scaled independently
  • BFF Pattern: Promotion has dedicated Backend For Frontend
  • CRITICAL: All at 1 replica (complete lack of HA)