{"id":9708,"date":"2023-03-22T15:16:21","date_gmt":"2023-03-22T07:16:21","guid":{"rendered":"https:\/\/jpuyy.com\/?p=9708"},"modified":"2023-03-22T15:16:21","modified_gmt":"2023-03-22T07:16:21","slug":"k8s-lifecycle-prestop-for-nginx-pod","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=9708","title":{"rendered":"K8s lifecycle preStop for nginx pod"},"content":{"rendered":"<p>Trigger pre stop, to let the nginx pod consume the transactions while no new incoming connections<\/p>\n<pre>lifecycle:                                                              \n          preStop:                                                              \n            exec:                                                               \n              command:                                                          \n              - \/bin\/sh                                                         \n              - -c                                                              \n              - curl test.xxx.com\/prestop-sleep --resolve test.xxx.com:80:127.0.0.1; sleep 60; \/wait-shutdown\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Trigger pre stop, to let the nginx pod consume the transactions while no new incoming connections lifecycle: preStop: exec: command: &#8211; \/bin\/sh &#8211; -c &#8211; curl test.xxx.com\/prestop-sleep &#8211;resolve test.xxx.com:80:127.0.0.1; sleep 60; \/wait-shutdown<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-9708","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/9708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9708"}],"version-history":[{"count":1,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/9708\/revisions"}],"predecessor-version":[{"id":9709,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/9708\/revisions\/9709"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}