Skip to content

Rolling updater should be more resilient when maintaining SLA during scaling #3844

Closed

Description

@ironcladlou

The enhancements to rolling updates for #3701 include a change to allow the updater to maintain an SLA represented by a minimum percentage of ready pods to remain ready for the duration of the deployment. However, the mechanism is brittle: during a given scale-up each interval, if any pods in the current chunk don't become ready in time, the updater gives up entirely and immediately.

The scaling should be more resiliant by continuing to scale down and up as long as possible subject to timeouts given the total pod readiness count hasn't dipped below the minimum representing the SLA from the configurable update percentage. The scaling increment each interval should be variable, treating the SLA minimum as the basis for a maxium increment per interval.

The updater should know what the minimum ready count threshold is, and should do "as much as possible" each interval within the bounds of the SLA.

This is an extension of kubernetes/kubernetes#10062.

Activity

  1. changed the title [-]Rolling updater should be more resiliant when maintaining SLA during scaling[/-] [+]Rolling updater should be more resilient when maintaining SLA during scaling[/+] on Jul 22, 2015
  2. ironcladlou commented on Jul 22, 2015

    @ironcladlou
    ContributorAuthor

    @smarterclayton this needs prioritized/scheduled.

  3. smarterclayton commented on Jul 22, 2015

    @smarterclayton
    Contributor

    p1 - I would like it to make 3.0.1 but that depends on how complex you think this is.

  4. ironcladlou commented on Jul 22, 2015

    @ironcladlou
    ContributorAuthor

    Is there a use case for scaling by % and not also enforcing an SLA?

  5. smarterclayton commented on Jul 22, 2015

    @smarterclayton
    Contributor

    I can think of a use case of down the road making the SLA a separate
    parameter. In the short term, I think not.

    On Wed, Jul 22, 2015 at 3:21 PM, Dan Mace [email protected] wrote:

    Is there a use case for scaling by % and not also enforcing an SLA?

    —
    Reply to this email directly or view it on GitHub
    #3844 (comment).

    Clayton Coleman | Lead Engineer, OpenShift

  6. ironcladlou commented on Jul 22, 2015

    @ironcladlou
    ContributorAuthor

    What would greatly simplify things would be to eliminate modality and make it more opinionated: scratch the updateAcceptor concept, compute an SLA/minimum, and each interval do what you can within the bounds of the min/max. Readiness checks baked right in (instead of outside in an acceptor).

  7. smarterclayton commented on Jul 22, 2015

    @smarterclayton
    Contributor

    Maybe make the "is this ready" check an interface.

    On Wed, Jul 22, 2015 at 3:25 PM, Dan Mace [email protected] wrote:

    What would greatly simplify things would be to eliminate modality and make
    it more opinionated: scratch the updateAcceptor concept, compute an
    SLA/minimum, and each interval do what you can within the bounds of the
    min/max. Readiness checks baked right in (instead of outside in an
    acceptor).

    —
    Reply to this email directly or view it on GitHub
    #3844 (comment).

    Clayton Coleman | Lead Engineer, OpenShift

  8. ironcladlou commented on Jul 22, 2015

    @ironcladlou
    ContributorAuthor

    That might be good... I've got a sketch for this in a branch and will have something tangible to discuss further tomrorow.

  9. ironcladlou commented on Jul 23, 2015

    @ironcladlou
    ContributorAuthor

    So here's an interesting case. If at the beginning your old deployment is at 2, and your new desired is 10, and your update factor is 10%, your the contract is to keep 9 total running during the transition. Assume down/up. This means we start off violating the minimum. The way our algo currently works is that we'll block waiting for more pods to become ready since if we scaled down we'll violate the minimum. One option would be to "lie" by no-op'ing and returning that we scaled down the difference of max(minimum-actual, maxIncrement) so that the scale up would attempt to bring us back over the line.

  10. ironcladlou commented on Jul 23, 2015

    @ironcladlou
    ContributorAuthor

    Actually, if we're already under the threshold, how about on scale down no-op'ing and just informing the scale up to scale up by maxIncrement... this will repeat until we're back above board

  11. smarterclayton commented on Jul 23, 2015

    @smarterclayton
    Contributor

    SLA is the min of new / old.

    On Jul 23, 2015, at 5:04 PM, Dan Mace [email protected] wrote:

    So here's an interesting case. If at the beginning your old deployment is
    at 2, and your new desired is 10, and your update factor is 10%, your the
    contract is to keep 9 total running during the transition. Assume down/up.
    This means we start off violating the minimum. The way our algo currently
    works is that we'll block waiting for more pods to become ready since if we
    scaled down we'll violate the minimum. One option would be to "lie" by
    no-op'ing and returning that we scaled down the difference of
    max(minimum-actual, maxIncrement) so that the scale up would attempt to
    bring us back over the line.

    —
    Reply to this email directly or view it on GitHub
    #3844 (comment).

  12. smarterclayton commented on Jul 23, 2015

    @smarterclayton
    Contributor

    That's possible - after you do the canary

    On Jul 23, 2015, at 5:10 PM, Dan Mace [email protected] wrote:

    Actually, if we're already under the threshold, how about on scale down
    no-op'ing and just informing the scale up to scale up by maxIncrement...
    this will repeat until we're back above board

    —
    Reply to this email directly or view it on GitHub
    #3844 (comment).

  13. ironcladlou commented on Jul 23, 2015

    @ironcladlou
    ContributorAuthor

    SLA is the min of new / old.

    You mean 100-N% of min(oldActualReplicas, newDesired)?

  14. smarterclayton commented on Jul 23, 2015

    @smarterclayton
    Contributor

    Well, juts from the perspective of - if you are at 2 now, you can't pretend
    that your SLA is really 10. Once the deployment completes, your SLA is 10.

    Also. we should be able to mark the deployment successful and NOT roll it
    back once all old pods are gone and SLA % of pods are ready.

    On Thu, Jul 23, 2015 at 5:13 PM, Dan Mace [email protected] wrote:

    SLA is the min of new / old.

    You mean 100-N% of min(oldActualReplicas, newDesired)?

    —
    Reply to this email directly or view it on GitHub
    #3844 (comment).

    Clayton Coleman | Lead Engineer, OpenShift

  15. ironcladlou commented on Jul 23, 2015

    @ironcladlou
    ContributorAuthor

    Well, juts from the perspective of - if you are at 2 now, you can't pretend that your SLA is really 10. Once the deployment completes, your SLA is 10.

    Yeah, makes sense. Going with the min calculation I described.

  16. ironcladlou commented on Jul 24, 2015

    @ironcladlou
    ContributorAuthor

    Another asymmetry nuance: when there's an imbalance like old=2, new=4, shouldn't the actual % increment be based on the min of old/new? Or actually, should the max increment always be a percentage of the old replicas?

  17. smarterclayton commented on Jul 24, 2015

    @smarterclayton
    Contributor

    Hrm - the SLA is the percentage on the old. I think the increment should
    be percentage of the new. Then if you have the SLA acting as the floor you
    still make progress.

    On Jul 24, 2015, at 10:11 AM, Dan Mace [email protected] wrote:

    Another asymmetry nuance: when there's an imbalance like old=2, new=4,
    shouldn't the actual % increment be based on the min of old/new? Or
    actually, should the max increment always be a percentage of the old
    replicas?

    —
    Reply to this email directly or view it on GitHub
    #3844 (comment).

  18. ironcladlou commented on Jul 24, 2015

    @ironcladlou
    ContributorAuthor

    Hrm - the SLA is the percentage on the old. I think the increment should be percentage of the new. Then if you have the SLA acting as the floor you still make progress.

    I think that's what we're looking for.

  19. ironcladlou commented on Jul 27, 2015

    @ironcladlou
    ContributorAuthor

    @smarterclayton

    @Kargakis found a scenario which seems a little nuanced. During a scale down event, it's possible that for external reasons, pods for either the old or new RC could go sideways, bringing our ready count under the SLA for reasons outside our control. Let's say that we computed the SLA, and then on the very first scale down, some old pods for the current prod deployment became unready for some reason and now we're already under the SLA. We have some options to consider:

    1. Don't scale down further, scale up new to (max increment + deficit) to get us back above board
    2. No-op and keep iterating, hoping that the readiness issues are transient (seems safe but slow)
    3. Fail because we couldn't preserve the SLA

    1 is problematic because it only works if you're doing up-down; we can't add pods without making capacity with a scale-down for the in-place configuration.

  20. smarterclayton commented on Jul 27, 2015

    @smarterclayton
    Contributor

    Discussed in IRC - I don't think it's our responsibility to watch readiness
    on old rc - only to ensure we don't cause an SLA violation ourselves. A
    health monitor on the old rc would be responsible for handling pods going
    dead. Maybe eventually we have a flag or mode that does additional
    readiness checking, but not now.

    On Jul 27, 2015, at 10:56 AM, Dan Mace [email protected] wrote:

    @smarterclayton https://github.com/smarterclayton

    @Kargakis https://github.com/kargakis found a scenario which seems a
    little nuanced. During a scale down event, it's possible that for external
    reasons, pods for either the old or new RC could go sideways, bringing our
    ready count under the SLA for reasons outside our control. Let's say that
    we computed the SLA, and then on the very first scale down, some old pods
    for the current prod deployment became unready for some reason and now
    we're already under the SLA. We have some options to consider:

    1. Don't scale down further, scale up new to (max increment + deficit)
      to get us back above board
    2. No-op and keep iterating, hoping that the readiness issues are
      transient (seems safe but slow)
    3. Fail because we couldn't preserve the SLA

    1 is problematic because it only works if you're doing up-down; we can't
    add pods without making capacity with a scale-down for the in-place
    configuration.

    —
    Reply to this email directly or view it on GitHub
    #3844 (comment).

  21. ironcladlou commented on Jul 28, 2015

    @ironcladlou
    ContributorAuthor

    Upstream PR for continued discussion: kubernetes/kubernetes#11942

  22. ironcladlou commented on Aug 20, 2015

    @ironcladlou
    ContributorAuthor
  23. smarterclayton commented on Sep 10, 2015

    @smarterclayton
    Contributor

    This has been implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions