You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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.
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.
@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.
@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.
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.
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.
[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).
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.
[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).
Activity
ironcladlou commentedon Mar 11, 2015
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.
abhgupta commentedon Mar 11, 2015
@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.
abhgupta commentedon Mar 11, 2015
@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.
pweil- commentedon Mar 11, 2015
I agree that it does sound like a rolling strategy is what we're looking for here.
smarterclayton commentedon Mar 14, 2015
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.
smarterclayton commentedon Mar 14, 2015
A pod going into shutdown should remove its endpoint immediately
smarterclayton commentedon Jun 8, 2015
Someone needs to test this with a readiness check and without.
abhgupta commentedon Jun 10, 2015
@ramr Can you please help out with this? Feel free to reach out to @pweil- for any questions.
ramr commentedon Jun 10, 2015
@abhgupta - will take a look.
pweil- commentedon Jun 12, 2015
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
killPodcall. 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.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
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?
smarterclayton commentedon Jun 12, 2015
Yup
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
openshift#1148: Support updates to Instances (openshift#1289)
Merge pull request openshift#1289 from simo5/roledel