Ignoring Primary desiredReplicas sync from Canary desiredReplicas #1349
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes - #1347
Ref - https://docs.flagger.app/usage/how-it-works
The autoscaler reference is optional, when specified, Flagger will pause the traffic increase while the target and primary deployments are scaled up or down. HPA can help reduce the resource usage during the canary analysis. When the autoscaler reference is specified, any changes made to the autoscaler are only made active in the primary autoscaler when a rollout for the deployment starts and completes successfully. Optionally, you can create two HPAs, one for canary and one for the primary to update the HPA without doing a new rollout. As the canary deployment will be scaled to 0, the HPA on the canary will be inactive.
Q. Why we wanted to use 2 explicit HPAs?
A. Use Case - If our HPA had minReplicas = 100, maxReplicas = 200 and currently desiredReplicas = 150, then during deployment Flagger will setup Canary HPA's minReplicas = 100, which will cause DB Pool Connection throttling. Hence, on using 2 different HPAs for Canary and Primary, we can define minReplicas for canary HPA.
Issue - On using 2 explicit HPAs, during canary, Primary Replicas = Canary Replicas.
Example -
Canary HPA -
Primary HPA -
So, after Canary Analysis, Primary HPA's desiredReplicas = Canary HPA's desiredReplicas. Now, our production live app will have Primary HPA's desiredReplicas = 5, hence our app which was being served by 150 pods, now will be served by only 5 pods. Hence, total production downtime.