Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autoscaling bug with number of replicas #72

Merged
merged 3 commits into from
Apr 13, 2020
Merged

Fix autoscaling bug with number of replicas #72

merged 3 commits into from
Apr 13, 2020

Conversation

edavidj
Copy link
Contributor

@edavidj edavidj commented Apr 13, 2020

What this PR does / why we need it?:

  • Adds a guard to the deployment/statefulset customization functions that checks for the existence of autoscaler in the spec before updating the # of replicas in the resource. This prevents the loop of operator contradicting the HPA.
  • My changes assume that we do not want the operator to touch the # of replicas if there's an autoscaler enabled.
  • Updated the autoscaler test to watch that the deployment actually gets to the minimum number of replicas before passing the test. Rather than just watching the HPA resource definition.
    • Note that I actually don't think this e2e CAN catch this specific failure, as it still technically reaches 2 replicas momentarily and then starts going up and down over and over. This would be better mandated by unit tests.

Which issue(s) this PR fixes:

Fixes #68

* Target min replicas on the min and max replica tests so that it
waits for the actual deployment to update rather than just the HPA.
@edavidj edavidj requested a review from leochr April 13, 2020 16:27
Copy link
Member

@leochr leochr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @edavidj!

@leochr leochr merged commit 1148485 into master Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto scaling is not working as expected
2 participants