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 HPA feedback from writing status.replicas to spec.replicas. #79035

Merged
merged 1 commit into from Jul 2, 2019

Commits on Jul 2, 2019

  1. There are various reasons that the HPA will decide not the change the

    current scale. Two important ones are when missing metrics might
    change the direction of scaling, and when the recommended scale is
    within tolerance of the current scale.
    
    The way that ReplicaCalculator signals it's desire to not change the
    current scale is by returning the current scale. However the current
    scale is from scale.Status.Replicas and can be larger than
    scale.Spec.Replicas (e.g. during Deployment rollout with configured
    surge). This causes a positive feedback loop because
    scale.Status.Replicas is written back into scale.Spec.Replicas,
    further increasing the current scale.
    
    This PR fixes the feedback loop by plumbing the replica count from
    spec through horizontal.go and replica_calculator.go so the calculator
    can punt with the right value.
    Joseph Burnett committed Jul 2, 2019
    Copy the full SHA
    39c4875 View commit details
    Browse the repository at this point in the history