{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/8641","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/8641/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/8641/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/8641/events","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/8641","id":79192747,"number":8641,"title":"WIP - Gracefully delete pods from the Kubelet","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"ECF7EC"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-05-21T22:49:25Z","updated_at":"2015-05-22T17:58:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/8641","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/8641","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/8641.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/8641.patch"},"body":"This commit wires together the graceful delete option for pods on the Kubelet.  When a pod is deleted on the API server, a grace period is calculated that is based on the `Pod.Spec.TerminationGracePeriodInSeconds`, the user's provided grace period, or a default (30 seconds).  The grace period can only shrink once set. The value provided by the user (or the default) is set onto pod.Spec directly.\r\n\r\nWhen the Kubelet sees a pod with DeletionTimestamp set, it uses the value of Spec.TerminationGracePeriodInSeconds as the grace period sent to Docker.  When updating status, if the pod has DeletionTimestamp set and all containers are terminated, the Kubelet will update the\r\nstatus one last time and then invoke Delete(pod, grace: 0) to clean up the pod immediately.\r\n\r\nThis still needs tests and some e2e testing but is functionally complete.\r\n\r\nWhy this matters:\r\n\r\n* No one wants their database SIGKILL'ed\r\n\r\nKnown gaps:\r\n\r\n* [ ] test when kubelet is restarted\r\n* [ ] test graceful max is in place\r\n* [ ] show indication in pod describe the resource is deleting\r\n* [ ] verify replication controller handles this gracefully\r\n\r\nOpen questions\r\n\r\n* Should we remove deleting pods (DeletionTimestamp) from replication controller and endpoints controller counts immediately?\r\n* Is 30s a good default?\r\n\r\nImplements #1535 for pods"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/104729674","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/8641#issuecomment-104729674","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/8641","id":104729674,"user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T17:58:48Z","updated_at":"2015-05-22T17:58:48Z","body":"I added a filter based on metadata.deletionTimestamp - are you saying that the cache doesn't contain that info and my logic is flawed?\n\nIn kubectl I think we'd hijack the status field for now.\n\n----- Original Message -----\n> I agree about having too many phases, but currently the rcs only filter based\n> on phase, they never open up a pod to check other user defined fields\n> (breaking this won't be too bad I suppose, but I could then make the rcs\n> check restart policy, and so on). I'm curious how we're going to surface a\n> pending delete (via `Message` in kubectl?).\n> \n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/GoogleCloudPlatform/kubernetes/pull/8641#issuecomment-104722621\n"}}