Skip to content

Rollback orchestration with routes #1289

Closed

Description

@pweil-

@thoraxe noticed that while performing a rollback you can get into a situation where the current pods are deleted prior to the service being updated with new endpoints. The effect on the route was that you would receive a 503 until the new pods are up and can be resolved by the router.

Opening this issue to discuss if we can orchestrate the ordering of rollback, if we want to possibly use route parking (https://trello.com/c/kXrvPFdh/667-3-route-parking-routing-future), or if this is just going to be a known downtime issue during an exceptional condition that requires rollback.

/cc @ironcladlou @abhgupta

Activity

  1. ironcladlou commented on Mar 11, 2015

    @ironcladlou
    Contributor

    I wonder if this would be naturally resolved for deployments using a rolling strategy (coming soon). Rollbacks for deployments using the recreate strategy (all of them) inherently have the race you describe since they don't benefit from any availability checking, checkpointing, etc that would be present in a smarter (e.g. rolling) strategy.

  2. abhgupta commented on Mar 11, 2015

    @abhgupta
    Member

    @ironcladlou beat me to it. I would completely agree. We should handle this with rolling deployments and other deployment strategies that can be created to deal with any specific cases.

  3. abhgupta commented on Mar 11, 2015

    @abhgupta
    Member

    @pweil- route parking would not be my first approach for the default implementation. That is an option that can be excercised during upgrades that will require downtime. Eventually, we could have a deployment strategy that did "park" the routes during a deployment.

  4. pweil- commented on Mar 11, 2015

    @pweil-
    Author

    I agree that it does sound like a rolling strategy is what we're looking for here.

  5. smarterclayton commented on Mar 14, 2015

    @smarterclayton
    Contributor

    Also without graceful shutdown you can't prevent connections from being interrupted. Rolling and that need to land, with readiness checks taking the third part. Endpoints on containers going down should be updated more rapidly which depends on kubelet posting status.

  6. smarterclayton commented on Mar 14, 2015

    @smarterclayton
    Contributor

    A pod going into shutdown should remove its endpoint immediately

  7. smarterclayton commented on Jun 8, 2015

    @smarterclayton
    Contributor

    Someone needs to test this with a readiness check and without.

  8. abhgupta commented on Jun 10, 2015

    @abhgupta
    Member

    @ramr Can you please help out with this? Feel free to reach out to @pweil- for any questions.

  9. ramr commented on Jun 10, 2015

    @ramr
    Contributor

    @abhgupta - will take a look.

  10. pweil- commented on Jun 12, 2015

    @pweil-
    Author

    A pod going into shutdown should remove its endpoint immediately

    A pod is removed from the endpoints when the pod is deleted from etcd, regardless of the kubelet's state (ie running shutdown hooks). To doubly test this, I forced the kubelet to throw an error for any killPod call. The pod was immediately removed from the endpoint list even with the pod still running. This means that it would also be removed from the routes since they are based on the endpoints.

    Someone needs to test this with a readiness check and without.

    When endpoints are synchronized it will not add an endpoint until the pod is considered ready. https://github.com/pweil-/origin/blob/master/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/service/endpoints_controller.go#L323-323

    [vagrant@openshiftdev ~]$ oc get endpoints hello-nginx
    NAME          ENDPOINTS
    hello-nginx   172.17.0.8:8080,172.17.0.9:8080
    
    [vagrant@openshiftdev ~]$ oc delete pod hello-openshift2
    pods/hello-openshift2
    
    E0612 01:55:14.683846    4948 kubelet.go:1408] Failed killing the pod "hello-openshift2": ------------------------------------------------------- you can't kill me!
    
    [vagrant@openshiftdev ~]$ oc get endpoints hello-nginx
    NAME          ENDPOINTS
    hello-nginx   172.17.0.8:8080
    
    [vagrant@openshiftdev ~]$ docker ps
    CONTAINER ID        IMAGE                              COMMAND              CREATED              STATUS              PORTS               NAMES
    cd6cf0398013        openshift/hello-openshift:latest   "/hello-openshift"   59 seconds ago       Up 53 seconds                           k8s_hello-openshift2.8240796d_hello-openshift2_default_fa7217a1-10a5-11e5-8c38-080027c5bfa9_ffc37770   
    35d0293b45b1        openshift/origin-pod:latest        "/pod"               About a minute ago   Up 59 seconds                           k8s_POD.4a25e679_hello-openshift2_default_fa7217a1-10a5-11e5-8c38-080027c5bfa9_c7830623                
    987de8853712        openshift/hello-openshift:latest   "/hello-openshift"   About a minute ago   Up 59 seconds                           k8s_hello-openshift.afe5793b_hello-openshift_default_f8ef3c86-10a5-11e5-8c38-080027c5bfa9_58e14451     
    9ff721f128b0        openshift/origin-pod:latest        "/pod"               About a minute ago   Up About a minute                       k8s_POD.4a25e679_hello-openshift_default_f8ef3c86-10a5-11e5-8c38-080027c5bfa9_b3abea2b    
    

    Since a rolling deployment is based around using a single service and adding/removing pods in increments the service would balance between the pods and achieve the desired effect. It would be up to the pod creator to ensure that the pod's shutdown hook ensures that active connections are closed before the pod is removed (ie an exec hook that spins until it is ready).

    @abhgupta @ironcladlou @ramr @smarterclayton Do you feel this satisfies the testing requirements?

  11. smarterclayton commented on Jun 12, 2015

    @smarterclayton
    Contributor

    Yup

    On Jun 11, 2015, at 10:05 PM, Paul Weil [email protected] wrote:

    A pod going into shutdown should remove its endpoint immediately

    A pod is removed from the endpoints when the pod is deleted from etcd, regardless of the kubelet's state (ie running shutdown hooks). To doubly test this, I forced the kubelet to throw an error for any killPod call. The pod was immediately removed from the endpoint list even with the pod still running. This means that it would also be removed from the routes since they are based on the endpoints.

    Someone needs to test this with a readiness check and without.

    When endpoints are synchronized it will not add an endpoint until the pod is considered ready. https://github.com/pweil-/origin/blob/master/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/service/endpoints_controller.go#L323-323

    [vagrant@openshiftdev ~]$ oc get endpoints hello-nginx
    NAME ENDPOINTS
    hello-nginx 172.17.0.8:8080,172.17.0.9:8080

    [vagrant@openshiftdev ~]$ oc delete pod hello-openshift2
    pods/hello-openshift2

    E0612 01:55:14.683846 4948 kubelet.go:1408] Failed killing the pod "hello-openshift2": ------------------------------------------------------- you can't kill me!

    [vagrant@openshiftdev ~]$ oc get endpoints hello-nginx
    NAME ENDPOINTS
    hello-nginx 172.17.0.8:8080

    [vagrant@openshiftdev ~]$ docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    cd6cf0398013 openshift/hello-openshift:latest "/hello-openshift" 59 seconds ago Up 53 seconds k8s_hello-openshift2.8240796d_hello-openshift2_default_fa7217a1-10a5-11e5-8c38-080027c5bfa9_ffc37770
    35d0293b45b1 openshift/origin-pod:latest "/pod" About a minute ago Up 59 seconds k8s_POD.4a25e679_hello-openshift2_default_fa7217a1-10a5-11e5-8c38-080027c5bfa9_c7830623
    987de8853712 openshift/hello-openshift:latest "/hello-openshift" About a minute ago Up 59 seconds k8s_hello-openshift.afe5793b_hello-openshift_default_f8ef3c86-10a5-11e5-8c38-080027c5bfa9_58e14451
    9ff721f128b0 openshift/origin-pod:latest "/pod" About a minute ago Up About a minute k8s_POD.4a25e679_hello-openshift_default_f8ef3c86-10a5-11e5-8c38-080027c5bfa9_b3abea2b
    Since a rolling deployment is based around using a single service and adding/removing pods in increments the service would balance between the pods and achieve the desired effect. It would be up to the pod creator to ensure that the pod's shutdown hook ensures that active connections are closed before the pod is removed (ie an exec hook that spins until it is ready).

    @abhgupta @ironcladlou @ramr @smarterclayton Do you feel this satisfies the testing requirements?

    —
    Reply to this email directly or view it on GitHub.

  12. added a commit that references this issue on Feb 1, 2018
  13. added a commit that references this issue on Jun 27, 2018
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