HPA and ArgoCD - scaling is disabled since the replica count of the target is zero #3059
-
Hi there, I've created a Deployment without setting replicas and created a ScaledObject for scaling the deployment based on number of messages in AWS SQS. The Problem When setting replicas in the deployment to eg. to 1 the HPA will work as expected and the ScaledObject will show active state BUT ArgoCD`s AutoSync will fight till infinity against the difference from the deployment spec and terminate/create replicas . Why the HPA requires the deployment to have a replica count set? As a workaround I disabled the AutoSync for the Deployments which are scaled by the HPA but ArgoCD will show them as OutOfSync. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
HPA doesn't properly support scaling to 0, but that's something that KEDA does. So once the Deployment is scaled to 0, KEDA will activate it to 1 replica, you shouldn't do that. So your original ask (scale 0<->N replicas based on AWS SQS) should work properly, without your interaction. But there should be only one controller that manages the number of replicas in the Deployment, so in this case it is KEDA. If you have additional tool that tries to modify the replica number, it will result in conflicts. So in this case it is probably the ArgoCD AutoSync. |
Beta Was this translation helpful? Give feedback.
-
All things considered, fwiw, disabling autosync in Argo is not a recommended approach (although different teams/orgs have differing deployment workflows). A better approach is to update Argo's application (declaratively in the YAML) - documented at https://argo-cd.readthedocs.io/en/stable/user-guide/diffing/#application-level-configuration |
Beta Was this translation helpful? Give feedback.
-
Is there a conclusion to managing KEDA with ArgoCD? since I got same issue |
Beta Was this translation helpful? Give feedback.
Is there a conclusion to managing KEDA with ArgoCD? since I got same issue