How safwank97/aro-rp works
Project Type and Purpose
• This is a cloud Resource Provider (RP) for Azure Red Hat OpenShift—a full-stack, microservices-style application that exposes an ARM-compliant HTTP API, persists state in CosmosDB, processes cluster create/update/delete operations via backend workers, and runs an in-cluster operator for ongoing cluster management.
Main Components
a. Azure ARM Frontend Layer
• Azure Resource Manager (external) issues REST PUT/GET/DELETE calls
• cmd/aro (CLI entrypoint for “az aro”)
• pkg/frontend: spec-compliant HTTP server (Go, Gorilla mux)
• pkg/gateway: optional HTTP(S) middleware/gateway
• CosmosDB (Azure CosmosDB)
b. Asynchronous Backend Workers
• pkg/backend: workers poll CosmosDB changefeed (non-terminal documents)
• pkg/cluster: wraps OpenShift installer for create/update/delete
• pkg/deploy and pkg/env: generate and deploy ARM templates & VMSS
• pkg/database: CosmosDB wrapper, optimistic concurrency
c. In-Cluster Operator
• pkg/operator/controllers: a suite of Kubernetes controllers running inside each OpenShift cluster
• CRDs (aro.openshift.io v1alpha1, preview.aro.openshift.io)
• Uses Kubernetes API server, dynamic-helper caches
d. User Portal & Proxy
• pkg/portal: React/Go portal for metrics, kubeconfig requests
• portal/v2: standalone React frontend served from pkg/portal
• pkg/proxy: reverse proxy for cluster-API calls (SSH, Prometheus)
e. Clients & Specs
• pkg/swagger: generates ARM Swagger specs
• python/az/aro: Python CLI extension & autogenerated Python client
• pkg/client/services/redhatopenshift: Go client for RedHat OpenShift ARM APIs
f. Shared Utilities & Monitoring
• pkg/util & pkg/metrics: common abstractions (Azure SDK wrappers, logging, statsd)
• Azure Monitor, StatsD for telemetry
Architectural Patterns & Principles
• Microservices / layered services: separate HTTP-API layer, asynchronous worker layer, in-cluster operator layer
• Event-driven: CosmosDB changefeed triggers backend workers
• Idempotent & crash-safe: optimistic concurrency, missing-field passthrough
• Versioned APIs: pkg/api defines internal/external API versions with strong validation
• Horizontal scale: frontends and workers are stateless (scale out via Kubernetes or VMSS)