Skip to content

Add MinReadySeconds to DCs #7114

Closed
Closed

Description

@0xmichalis

Readiness in Kubernetes deployments is dictated by MinReadySeconds. We consider pods available as soon as they become ready w/o imposing any additional restriction.

    // Minimum number of seconds for which a newly created pod should be ready
    // without any of its container crashing, for it to be considered available.
    // Defaults to 0 (pod will be considered available as soon as it is ready)
    MinReadySeconds int32 `json:"minReadySeconds,omitempty"`

This issue is for tracking this gap.

@ironcladlou @smarterclayton @pweil-

Activity

  1. assigned and unassigned on Feb 8, 2016
  2. stevekuznetsov commented on May 11, 2016

    @stevekuznetsov
    Contributor

    @smarterclayton do we have executive direction on this gap?

  3. 0xmichalis commented on May 11, 2016

    @0xmichalis
    ContributorAuthor

    I was thinking that we may want to skip this and always default to 0 (consider available when ready).

  4. smarterclayton commented on May 11, 2016

    @smarterclayton
    Contributor

    I would like to have this - since I was the one who proposed it to Dan originally.

  5. 0xmichalis commented on May 12, 2016

    @0xmichalis
    ContributorAuthor

    ok

  6. 0xmichalis commented on May 12, 2016

    @0xmichalis
    ContributorAuthor

    @stevekuznetsov I would like to get #6233 first and then you could add this.

  7. 0xmichalis commented on May 18, 2016

    @0xmichalis
    ContributorAuthor

    @stevekuznetsov did you start working on this? If not, I would like @mfojtik to take a stab at it.

  8. stevekuznetsov commented on May 19, 2016

    @stevekuznetsov
    Contributor

    I haven't yet, and I'm OOO until next week. @mfojtik thanks!

  9. 15 remaining items

  10. stevekuznetsov commented on May 20, 2016

    @stevekuznetsov
    Contributor

    I can see the value of marking the deployment as compete after the pods have been ready, healthy, and have serviced requests, but a seconds time out seems like the most fragile way of doing it. Seems like what you'd really want is a Jenkins pod our or whatever running an e2e suite, but the canonical action there is to label the image as successful, not the deployment.

  11. ironcladlou commented on May 20, 2016

    @ironcladlou
    Contributor

    I think @stevekuznetsov has convinced me that MinReadySeconds is redundant.

  12. smarterclayton commented on May 20, 2016

    @smarterclayton
    Contributor

    It's very, very common for services to crumple under load, or to manifest
    failures that would result in aborting the rollout.

    Imagine the simplest possible deployment - 2 pod rolling. Dev pushes a
    change and the rollout starts. The first pod comes up, reports ready, and
    start taking traffic. The next time that pod will be checked for
    readiness is configurable by the user, but defaults to 1m. Imagine the
    developer has a bug in his caching code - first user hits and immediately
    causes the error to manifest. The readiness check for that pod won't have
    a chance to report that error for one minute.

    In the meantime, the other pod is scaled up and hits the same scenario. As
    soon as that pod is ready, the deployment is marked successful. 30s later,
    both pods have failing readiness checks, both are out of rotation, and the
    app is down. The deployment failed to guard against failure.

    MinReadySeconds is necessary to allow the app author to design well written
    readiness checks that ensure deployment succeed. Without that there is no
    way to force deployments to give the readiness check the change to remain
    stable.

    On May 20, 2016, at 6:24 AM, Steve Kuznetsov [email protected]
    wrote:

    So we're dealing with a service that boots fine, and without load would
    signal ready & healthy forever, but might cave under load but only in the
    first X seconds after being ready, so we want to expose it to traffic so it
    has the chance of crashing? What if no traffic happens to be routed to that
    pod in the first X seconds and it crashes on getting the first packet after
    X+1 seconds? Sorry, not trying to be obtuse here, but this just seems like
    a very limited use case to be adding to the API. The decision making part
    of this PR has already happened, so you can ignore me, but when I'm back in
    the office I'd really appreciate some help understanding this use case.

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub
    #7114 (comment)

  13. stevekuznetsov commented on May 20, 2016

    @stevekuznetsov
    Contributor

    Do we want to be failing this at the deployment level?

    I'm not a sophisticated user of OpenShift but I thought that a mature pipeline would look like dev->testing->prod, so these checks should be happening prior to you deploying something to a "production" environment where real traffic is being directed there.

    Furthermore, there is no guarantee that the deployment you're making will be taking any load in the MinReadySeconds interval, making the check fragile.

    As a consumer of OpenShift, I would be very hesitant to use this feature because of that fragility. Hell, if I threw in a

    oc start-build my-build
    # wait for completion
    sleep 100

    into our Bash scripts, I'd get smacked and someone would tell me to use os::build::wait_for_start.

  14. smarterclayton commented on May 20, 2016

    @smarterclayton
    Contributor

    Yes, we do.

    On Fri, May 20, 2016 at 12:44 PM, Steve Kuznetsov [email protected]
    wrote:

    Do we want to be failing this at the deployment level?

    I'm not a sophisticated user of OpenShift but I thought that a mature
    pipeline would look like dev->testing->prod, so these checks should be
    happening prior to you deploying something to a "production" environment
    where real traffic is being directed there.

    Furthermore, there is no guarantee that the deployment you're making will
    be taking any load in the MinReadySeconds interval, making the check
    fragile.

    As a consumer of OpenShift, I would be very hesitant to use this feature
    because of that fragility. Hell, if I threw in a

    oc start-build my-build# wait for completion
    sleep 100

    into our Bash scripts, I'd get smacked and someone would tell me to use
    os::build::wait_for_start.

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub
    #7114 (comment)

  15. stevekuznetsov commented on May 20, 2016

    @stevekuznetsov
    Contributor

    Can't argue with that :)

  16. smarterclayton commented on May 20, 2016

    @smarterclayton
    Contributor

    Think about this as theory vs practice. In theory, you'd have this magic
    system where everything worked based on edge driven changes. But the
    reality is that there's an infinite amount of complexity within the app,
    and so we ultimately care about levels. One way to help stabilize levels
    is to ensure that you give the system time to burn in.

    On Fri, May 20, 2016 at 12:58 PM, Steve Kuznetsov [email protected]
    wrote:

    Can't argue with that :)

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub
    #7114 (comment)

  17. stevekuznetsov commented on May 20, 2016

    @stevekuznetsov
    Contributor

    Sure, I just didn't think we were going to be supporting a rolling deployment into production without testing as a good idea. This feature simply doesn't make sense if your rolling deployment into production happens after the success of some e2e tests labels an image as production ready - with OpenShift it should be trivial to keep your dev/test/prod deployment specs in sync and be confident that your testing will be relevant in that sense.

  18. smarterclayton commented on May 20, 2016

    @smarterclayton
    Contributor

    Testing in dev != verification in prod. Testing can only reduce the
    impact, but if you have no difference between stage and prod, then stage
    is prod. For instance, stage and prod usually have different secrets.
    Your readiness check might verify that you can contact a db with your
    secrets. But your readiness check can't verify that all the code that uses
    the secret behaves the same when real users are hitting the service, which
    is why you want to set a stabilization window.

    Imagine this case. Your readiness check simulates a user login (expensive,
    but possible). But can your readiness check simulate 1000 simultaneous
    users hitting your brand new pod? No.

    On May 20, 2016, at 1:18 PM, Steve Kuznetsov [email protected]
    wrote:

    Sure, I just didn't think we were going to be supporting a rolling
    deployment into production without testing as a good idea. This feature
    simply doesn't make sense if your rolling deployment into production
    happens after the success of some e2e tests labels an image as production
    ready - with OpenShift it should be trivial to keep your dev/test/prod
    deployment specs in sync and be confident that your testing will be
    relevant in that sense.

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub
    #7114 (comment)

  19. stevekuznetsov commented on May 20, 2016

    @stevekuznetsov
    Contributor

    I really hope you're not doing your thousand-user stress test in production, and especially that you're not doing it by hoping one thousand users log in in X seconds after the ready check success...

    As to your points about tangible differences in production environments, those make sense. We should doc the usefulness boundaries of this field and maybe even give warnings in oc status if users set the field to be shorter than a minute, or five minutes, or something, otherwise it's just fragile and could be a false sense of security when is utility is really minimal.

  20. smarterclayton commented on May 20, 2016

    @smarterclayton
    Contributor

    Definitely the description should include a use case for why you would
    use this - i.e., it only makes sense to set this to > your readiness
    interval, and in rough multiples

    On Fri, May 20, 2016 at 1:47 PM, Steve Kuznetsov [email protected]
    wrote:

    I really hope you're not doing your thousand-user stress test in
    production, and especially that you're not doing it by hoping one thousand
    users log in in X seconds after the ready check success...

    As to your points about tangible differences in production environments,
    those make sense. We should doc the usefulness boundaries of this field and
    maybe even give warnings in oc status if users set the field to be
    shorter than a minute, or five minutes, or something, otherwise it's just
    fragile and could be a false sense of security when is utility is really
    minimal.

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub
    #7114 (comment)

  21. 0xmichalis commented on Jun 23, 2016

    @0xmichalis
    ContributorAuthor
  22. mfojtik commented on Jun 27, 2016

    @mfojtik
    Contributor
  23. self-assigned this
    on Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions