Krkn Operator Console - Architecture
┌─────────────────────────────────────┐
│ User Browser │
└─────────────────────────────────────┘
↓ HTTPS
┌─────────────────────────────────────┐
│ OpenShift Route / K8s Ingress │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Console Service (ClusterIP) │
│ Port: 8080 │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Console Deployment (N replicas) │
│ └─ nginx + React SPA │
└─────────────────────────────────────┘
↓ HTTP (in-cluster)
┌─────────────────────────────────────┐
│ Operator API Service │
│ krkn-operator-controller-manager... │
│ Port: 8080 │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Operator Pod │
│ ├─ operator container (Go) │
│ └─ data-provider container (Py) │
└─────────────────────────────────────┘
Component Responsibilities
UI Layer : PatternFly components
State Management : React Context + useReducer
API Client : Typed service layer
Routing : React Router (future)
Static Serving : React build artifacts
API Proxy : /api/* → operator service (avoid CORS)
SPA Routing : Fallback to index.html
Deployment : 2 replicas for HA
Service : ClusterIP for internal access
Route/Ingress : External access with TLS
App Load
↓
[POST /targets] → UUID
↓
[Poll GET /targets/{UUID}] → 200 OK
↓
[GET /clusters?id={UUID}] → Cluster List
↓
User Selects Cluster
↓
(Future: Chaos Orchestration)
initializing → polling → selecting_cluster → (future states)
↓ ↓ ↓
error ← ─── ─ ─ ─ ─ ─ ─ ─ ─ ┘
React 18+
TypeScript 5+
PatternFly 4.x
Vite (build tool)
Docker multi-stage build
Nginx alpine
Kubernetes native manifests
No secrets in frontend (all API calls server-side authenticated)
HTTPS via Route/Ingress TLS
CORS handled by nginx proxy
CSP headers in nginx config (future)
Horizontal : Scale deployment replicas
Caching : nginx static asset caching
CDN : Future consideration for static assets
Monitoring & Observability
Health Checks : nginx / endpoint
Logs : stdout/stderr → cluster logging
Metrics : Future - Prometheus metrics from nginx
Development vs Production
Independent Scaling : UI ≠ Operator
Independent Releases : Frontend updates without operator downtime
Clean Separation : UI is just an API client
Standard Pattern : Matches Prometheus/Grafana, ArgoCD/UI, etc.