{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/35183","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/35183/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/35183/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/35183/events","html_url":"https://github.com/kubernetes/kubernetes/issues/35183","id":184177850,"number":35183,"title":"Pod or Job lifecycle lacks of a mechanism to define cleanup actions once you delete a pod","user":{"login":"hectorj2f","id":3602792,"avatar_url":"https://avatars.githubusercontent.com/u/3602792?v=3","gravatar_id":"","url":"https://api.github.com/users/hectorj2f","html_url":"https://github.com/hectorj2f","followers_url":"https://api.github.com/users/hectorj2f/followers","following_url":"https://api.github.com/users/hectorj2f/following{/other_user}","gists_url":"https://api.github.com/users/hectorj2f/gists{/gist_id}","starred_url":"https://api.github.com/users/hectorj2f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectorj2f/subscriptions","organizations_url":"https://api.github.com/users/hectorj2f/orgs","repos_url":"https://api.github.com/users/hectorj2f/repos","events_url":"https://api.github.com/users/hectorj2f/events{/privacy}","received_events_url":"https://api.github.com/users/hectorj2f/received_events","type":"User","site_admin":false},"labels":[{"id":126701924,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/app-lifecycle","name":"area/app-lifecycle","color":"0052cc","default":false},{"id":114528273,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/backlog","name":"priority/backlog","color":"fbca04","default":false},{"id":173493665,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/node","name":"sig/node","color":"d2b48c","default":false},{"id":243794453,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/ux%20(deprecated%20-%20do%20not%20use)","name":"team/ux (deprecated - do not use)","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-10-20T09:24:56Z","updated_at":"2016-12-22T15:14:23Z","closed_at":null,"body":"Our user story for a FEATURE REQUEST is the following: we have been developing distributed applications using systemd during long time. To coordinate them, we used fleet as distributed system to manage them all in our infra. However, we decided to move all our systems to Kubernetes since several months.\n\nRegardless of all the amazing features you can find in Kubernetes when defining applications. We are missing a good one, we had when creating systemd units. \n-  A mechanism to trigger deletion actions (cleanup tasks) once we delete a pod. e.g ExecStop, ExecStopPost instructions used to trigger actions when destroying or stopping a systemd unit.\n\nWe research among all the features and we couldn't find any available mechanism to trigger delete-or-cleanup actions. As an example, I have a pod that does some stuff (like adding a key to etcd, setting some iptable rules) when I delete the pod k8s doesn't provide a way to trigger an action (like removing the key from etcd, cleaning up all the iptable rules). So, we have to create some additional pods that do the jobs which is ugly from an app lifecycle definition.\n\nTherefore, I'd like to know or learn if there would be any possibility to get this functionality inside kubernetes. Also, if you know of any third party project trying to achieve the same goal, it'd be really helpful for us.\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/268819800","html_url":"https://github.com/kubernetes/kubernetes/issues/35183#issuecomment-268819800","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/35183","id":268819800,"user":{"login":"pigmej","id":496754,"avatar_url":"https://avatars.githubusercontent.com/u/496754?v=3","gravatar_id":"","url":"https://api.github.com/users/pigmej","html_url":"https://github.com/pigmej","followers_url":"https://api.github.com/users/pigmej/followers","following_url":"https://api.github.com/users/pigmej/following{/other_user}","gists_url":"https://api.github.com/users/pigmej/gists{/gist_id}","starred_url":"https://api.github.com/users/pigmej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pigmej/subscriptions","organizations_url":"https://api.github.com/users/pigmej/orgs","repos_url":"https://api.github.com/users/pigmej/repos","events_url":"https://api.github.com/users/pigmej/events{/privacy}","received_events_url":"https://api.github.com/users/pigmej/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T15:14:23Z","updated_at":"2016-12-22T15:14:23Z","body":"I can imagine some complications around that area. \r\n\r\nHow are we going to solve this problem:\r\n- user defines cleanup action (whatever we will call it)\r\n- node with a pod is down, therefore pod will be not able to call cleanup action\r\n- user want to delete pod from k8s system\r\nIt's obvious that then pod hooks weren't be executed, but then we will have 2 different behavior of the same.\r\n\r\nSecond problem:\r\n- user defines cleanup action\r\n- it crashes\r\n  - should we proceed with pod delete\r\n  - or maybe instead retry cleanup action? (how many times?)\r\n- what if cleanup can't succeed because of some conditions (`delete -f` ?)"}}
{"actor":{"display_login":"pigmej"}}