Deployment replica vs ScaledObject what takes precedence? #6854
-
Hi Deployments have a replica value. However, scaledobject in KEDA has the same thing. Eg this is evident here: https://thomasvanlaere.com/posts/2024/11/windows-containers-azure-pipeline-agents-with-entra-workload-id-in-azure-kubernetes-service/ But I am wondering, what takes precedence? Do I set the replica count to 0 and set my replica count in the scaledobject? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
When a scaledObject becomes active it determines the number of replicas. The previously given number of replicas in the deployment.yaml is then overruled. You can give this a value that you may like if you delete a scaledObject so that it then falls back to your default replicas. There are also another options, like permanently remove the default replicas from the deployment manifest. This forces the deployment to rely solely on KEDA’s autoscaling mechanism, ensuring that it always scales according to the That being said, you can also create a parameter in Helm, for example in your values file:
and your deployment.yaml:
Now it is dynamic based on your values.yaml. That is how I use it myself. |
Beta Was this translation helpful? Give feedback.
-
Ok thanks. One more thing, i assume KEDA works fine with a private AKS cluster? I am using it with the azure pipelines trigger. |
Beta Was this translation helpful? Give feedback.
When a scaledObject becomes active it determines the number of replicas. The previously given number of replicas in the deployment.yaml is then overruled. You can give this a value that you may like if you delete a scaledObject so that it then falls back to your default replicas.
There are also another options, like permanently remove the default replicas from the deployment manifest. This forces the deployment to rely solely on KEDA’s autoscaling mechanism, ensuring that it always scales according to the
minReplicaCount
specified in the ScaledObject configuration. However, it’s essential to ensure that KEDA’s autoscaling is enabled and properly configured.That being said, you can also c…