{"action":"opened","issue":{"url":"https://api.github.com/repos/kubernetes-sapporo-for-beginners/hands-on/issues/13","repository_url":"https://api.github.com/repos/kubernetes-sapporo-for-beginners/hands-on","labels_url":"https://api.github.com/repos/kubernetes-sapporo-for-beginners/hands-on/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes-sapporo-for-beginners/hands-on/issues/13/comments","events_url":"https://api.github.com/repos/kubernetes-sapporo-for-beginners/hands-on/issues/13/events","html_url":"https://github.com/kubernetes-sapporo-for-beginners/hands-on/issues/13","id":378295924,"node_id":"MDU6SXNzdWUzNzgyOTU5MjQ=","number":13,"title":"Step1-ApplicationDeployment: Terminate処理が遅い","user":{"login":"h-r-k-matsumoto","id":35314064,"node_id":"MDQ6VXNlcjM1MzE0MDY0","avatar_url":"https://avatars1.githubusercontent.com/u/35314064?v=4","gravatar_id":"","url":"https://api.github.com/users/h-r-k-matsumoto","html_url":"https://github.com/h-r-k-matsumoto","followers_url":"https://api.github.com/users/h-r-k-matsumoto/followers","following_url":"https://api.github.com/users/h-r-k-matsumoto/following{/other_user}","gists_url":"https://api.github.com/users/h-r-k-matsumoto/gists{/gist_id}","starred_url":"https://api.github.com/users/h-r-k-matsumoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-r-k-matsumoto/subscriptions","organizations_url":"https://api.github.com/users/h-r-k-matsumoto/orgs","repos_url":"https://api.github.com/users/h-r-k-matsumoto/repos","events_url":"https://api.github.com/users/h-r-k-matsumoto/events{/privacy}","received_events_url":"https://api.github.com/users/h-r-k-matsumoto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-07T13:51:01Z","updated_at":"2018-11-07T13:51:01Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## 問題\r\n`kubectl delete pod` を行なった際、なかなかpodが終了しない。\r\nterminationGracePeriodSecondsの時間をすぎて強制終了してる。\r\n\r\n## 原因\r\ncontainers `dummy` のせい。ちゃんとコンテナが停止されたと判断されていない。\r\nLivenessProbeを設定、およびexec を使いprocess id = 1と必ずするようにして見たがNG.\r\n```\r\n        args: [\"-c\", \"while true; do exec sleep 1000;done\"]\r\n        livenessProbe:\r\n          exec:\r\n            command:\r\n            - \"/bin/sh\"\r\n            - \"-c\"\r\n            - |\r\n              CNT=`ps auxww |grep sleep |grep -v grep |wc -l`;\r\n              test $CNT -gt 0 ;\r\n```\r\nshell使うのであれば、ファイル化して、execで起動しないとSIGTERMの受信できない、終了判断が行われないかも。\r\n\r\nhttps://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/\r\n\r\nstackoverflowで聞いてみよう。\r\n・・・これどんな場合にこんなことするの？って聞かれたら、「いや・・・ちょっと作って見ただけ」としか言いようがないけど。\r\n\r\n"}}
{"actor":{"display_login":"h-r-k-matsumoto"}}