-
Notifications
You must be signed in to change notification settings - Fork 558
Description
π Description
Devtron automatically detects current desiredReplicas from the HPA and sets the replicas according to it while sending a new deployment. This is done so that any application that has higher number of replicas brought up from an HPA isn't reset to the initial values specified in autoscaling configs/replicas.
If an HPA is not detected according to the HPA name template, it uses replica field from deployment-template ( Logic at https://github.com/devtron-labs/devtron/blob/5283e1c712c4a555c993a64247ecc058530ca1bf/pkg/app/AppService.go#LL2264C1-L2265C1 )
This logic needs to update to consider the HPA name template in case of fullnameOverride is used.
π Reproduction steps
- Create an app with autoscaling enabled and autoscaling.MinReplicas=2 and replicas=1
- Deploy this app and wait for it to get healthy.
- Ensure that Rolling strategy is configured with default setting (ie MaxUnavailable=1, maxSurge=25% )
- Redeploy this app with a different image and closely watch the app details while refreshing it on 10s intervals.
- The deployment will not respect rolling strategy and both the old pods will terminate creating a disruption.
π Expected behavior
The deployment should respect deployment strategy rolling and should terminate the pods one by one instead. The logic should auto-detect any HPA objects created either from rawYaml or from KedaAutoscaling and use relevant desired replicas from these objects instead of using replica from deployment-template.
π Actual Behavior
The deployment will not respect rolling strategy and both the old pods will terminate creating a disruption. This happens because the new deployment happens with replica=1 which is passed on from the deployment-configuration if an hpa (with the specified format ie appName-envName is not detected).
βΈ Kubernetes version
1.26
Cloud provider
π Browser
Chrome
π§± Your Environment
No response
β Proposed Solution
The hpa detection logic should auto-detect any HPA objects created either from rawYaml or from KedaAutoscaling and use relevant desired replicas from these objects instead of using replica from deployment-template.
π Have you spent some time to check if this issue has been raised before?
- I checked and didn't find any similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct
AB#3369