The following steps summarize how the Replica optimization solution works:
Collect and store metrics: VictoriaMetrics continuously collects container-level metrics and calculates derived performance metrics from the cluster.
Run recommendation cycle: The recommendation-maker runs its pipeline to calculate optimal CPU/memory requests per Pod and determine optimal target utilization before passing these outputs to the min replica recommender.
Execute algorithm and validate safety: The min replica calculator fetches active HPA parameters from the Kubernetes API, retrieves metrics from VictoriaMetrics, applies base or enhanced scenario algorithm logic, and validates safety constraints.
Update action plan: If changes are needed, the system generates and updates an Action CR with the required min replica recommendation details.
Apply changes: The action-taker reads the Action CR and applies the optimization by updating the HPA's minReplicas field in the cluster.
HPA scaling response: The native Kubernetes Horizontal Pod Autoscaler adjusts the actual running replica count fluidly based on the new minimum baseline and current workload load.