flagger
flagger copied to clipboard
Update to primaryScalerReplicas is ignored if no other changes inside the canary
Describe the bug
Updates to autoscalerRef.primaryScalerReplicas are ignored
autoscalerRef:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
name: service-deployment
primaryScalerReplicas:
maxReplicas: 4
minReplicas: 4
To Reproduce
- Create canary with autoscalerRef defined
autoscalerRef:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
name: service-deployment
primaryScalerReplicas:
maxReplicas: 2
minReplicas: 2
- Update maxReplicas/minReplicas
autoscalerRef:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
name: service-deployment
primaryScalerReplicas:
maxReplicas: 4
minReplicas: 4
-->
Result: Primary hpa is not updated and only 2 pod instance are running
kubectl get hpa service-deployment-primary --template='.spec.maxReplicas: {{.spec.maxReplicas}}{{"\n"}}.spec.minReplicas: {{.spec.minReplicas}}'
.spec.maxReplicas: 2
.spec.minReplicas: 2
Expected behavior
Primary hpa resource should be updated and primary pods scaled to 4 instances
Workaround
- we can patch the canary with pod annotation but this will trigger the canary release which is not ideal.
- we can update primary hpa manually but I expect this to happens automatically
Additional context
- Flagger version: 1.35.0
- Kubernetes version: 1.27
- Service Mesh provider: Linkerd