{"id":1889,"date":"2023-03-30T23:05:07","date_gmt":"2023-03-30T15:05:07","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1889"},"modified":"2023-04-22T08:59:33","modified_gmt":"2023-04-22T00:59:33","slug":"restart-kubernetes-cluster","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/30\/restart-kubernetes-cluster\/","title":{"rendered":"\u91cd\u542fKubernetes\u96c6\u7fa4"},"content":{"rendered":"<p>Kubernetes\u96c6\u7fa4\u7684\u8bbe\u8ba1\u76ee\u6807\u662f<code>setup-and-run-forever<\/code>\uff0c\u7136\u800c\u8bb8\u591a\u521d\u5b66\u8005\u5b89\u88c5K8S\u96c6\u7fa4\u7528\u4e8e\u5b66\u4e60\uff0c\u8fd9\u5c31\u5fc5\u7136\u4f1a\u51fa\u73b0\u91cd\u542f\u96c6\u7fa4\u7684\u60c5\u51b5\u3002<\/p>\n<h3>Worker\u8282\u70b9\u4e0d\u80fd\u542f\u52a8<\/h3>\n<p>Master \u8282\u70b9\u7684 IP \u5730\u5740\u53d8\u5316\uff0c\u5bfc\u81f4 worker \u8282\u70b9\u4e0d\u80fd\u542f\u52a8\u3002\u8bf7\u91cd\u88c5\u96c6\u7fa4\uff0c\u5e76\u786e\u4fdd\u6240\u6709\u8282\u70b9\u90fd\u6709\u56fa\u5b9a\u5185\u7f51 IP \u5730\u5740\u3002<\/p>\n<p><!-- more --><\/p>\n<h3>\u8bb8\u591aPod\u4e00\u76f4Crash\u6216\u4e0d\u80fd\u6b63\u5e38\u8bbf\u95ee<\/h3>\n<pre><code class=\"language-bash\">kubectl get pods --all-namespaces<\/code><\/pre>\n<p>\u91cd\u542f\u540e\u4f1a\u53d1\u73b0\u8bb8\u591a Pod \u4e0d\u5728 Running \u72b6\u6001\uff0c\u6b64\u65f6\uff0c\u8bf7\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5220\u9664\u8fd9\u4e9b\u72b6\u6001\u4e0d\u6b63\u5e38\u7684 Pod\u3002\u901a\u5e38\uff0c\u5982\u679c Pod \u662f\u4f7f\u7528<code>Deployment<\/code>\u3001<code>StatefulSet<\/code>\u7b49\u63a7\u5236\u5668\u521b\u5efa\u7684\uff0cKubernetes \u5c06\u521b\u5efa\u65b0\u7684 Pod \u4f5c\u4e3a\u66ff\u4ee3\uff0c\u91cd\u65b0\u542f\u52a8\u7684 Pod \u901a\u5e38\u80fd\u591f\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<pre><code class=\"language-bash\">kubectl delete pod &lt;pod-name&gt; -n &lt;pod-namespece&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Kubernetes\u96c6\u7fa4\u7684\u8bbe\u8ba1\u76ee\u6807\u662fsetup-and-run-forever\uff0c\u7136\u800c\u8bb8\u591a\u521d\u5b66\u8005\u5b89\u88c5K8S\u96c6\u7fa4\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[356],"class_list":["post-1889","post","type-post","status-publish","format-standard","hentry","category-k8s","tag-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1889","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1889"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1889\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}