{"id":1691,"date":"2026-06-08T18:12:54","date_gmt":"2026-06-08T10:12:54","guid":{"rendered":"https:\/\/www.izhuhn.cn\/?p=1691"},"modified":"2026-06-08T18:12:54","modified_gmt":"2026-06-08T10:12:54","slug":"kubernetes-%e6%a0%b8%e5%bf%83%e6%a6%82%e5%bf%b5%e4%b8%8e%e6%9e%b6%e6%9e%84%e7%ae%80%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.izhuhn.cn\/index.php\/2026\/06\/08\/kubernetes-%e6%a0%b8%e5%bf%83%e6%a6%82%e5%bf%b5%e4%b8%8e%e6%9e%b6%e6%9e%84%e7%ae%80%e8%ae%b0\/","title":{"rendered":"Kubernetes \u6838\u5fc3\u6982\u5ff5\u4e0e\u67b6\u6784\u7b80\u8bb0"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Kubernetes\uff08K8s\uff09\u662f\u4e00\u4e2a\u751f\u4ea7\u7ea7\u7684\u5bb9\u5668\u7f16\u6392\u5e73\u53f0\uff0c\u63d0\u4f9b\u5206\u5e03\u5f0f\u7cfb\u7edf\u8fd0\u884c\u6240\u9700\u7684\u5f39\u6027\u4f38\u7f29\u3001\u6545\u969c\u8f6c\u79fb\u548c\u90e8\u7f72\u7ba1\u7406\u80fd\u529b\u3002\u5176\u6838\u5fc3\u80fd\u529b\u901a\u8fc7\u5185\u7f6e\u7ec4\u4ef6\u5b9e\u73b0\uff0c\u65e0\u6cd5\u6ee1\u8db3\u7684\u573a\u666f\u53ef\u901a\u8fc7\u63d2\u4ef6\u6269\u5c55\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u6838\u5fc3\u7279\u6027<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">**\u670d\u52a1\u53d1\u73b0\u4e0e\u8d1f\u8f7d\u5747\u8861** Kubernetes \u4e3a\u6bcf\u4e2a Pod \u5206\u914d\u72ec\u7acb IP\uff0c\u5e76\u4e3a\u4e00\u7ec4 Pod \u63d0\u4f9b\u7edf\u4e00\u7684 Service DNS\u3002\u5f53\u65b0\u5bb9\u5668\u52a0\u5165\u6216\u9000\u51fa\u65f6\uff0cService \u81ea\u52a8\u611f\u77e5\u5e76\u8c03\u6574\u6d41\u91cf\u5206\u53d1\uff0c\u5b9e\u73b0\u52a8\u6001\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**\u5b58\u50a8\u7f16\u6392** \u652f\u6301\u81ea\u52a8\u6302\u8f7d\u672c\u5730\u5b58\u50a8\u3001\u4e91\u5b58\u50a8\uff08\u5982 AWS EBS\u3001GCE PD\u3001NFS \u7b49\uff09\uff0c\u53ef\u6309\u58f0\u660e\u5f0f\u914d\u7f6e\u81ea\u52a8\u521b\u5efa\u548c\u9500\u6bc1\u5b58\u50a8\u5377\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**\u81ea\u52a8\u90e8\u7f72\u4e0e\u56de\u6eda** \u901a\u8fc7\u58f0\u660e\u5f0f\u914d\u7f6e\u63cf\u8ff0\u671f\u671b\u72b6\u6001\uff0cKubernetes \u9010\u6b65\u5c06\u5b9e\u9645\u72b6\u6001\u8c03\u8c10\u4e3a\u76ee\u6807\u72b6\u6001\u3002\u652f\u6301\u6eda\u52a8\u66f4\u65b0\u3001\u6309\u7248\u672c\u56de\u6eda\uff0c\u4ee5\u53ca\u6682\u505c\/\u6062\u590d\u90e8\u7f72\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**\u81ea\u52a8\u88c5\u7bb1\u8ba1\u7b97** \u7528\u6237\u53ea\u9700\u58f0\u660e\u5bb9\u5668\u7684 CPU \u548c\u5185\u5b58 requests\/limits\uff0cKubernetes \u8c03\u5ea6\u5668\u4f1a\u81ea\u52a8\u4e3a Pod \u9009\u62e9\u6ee1\u8db3\u8d44\u6e90\u9700\u6c42\u7684\u6700\u4f18\u8282\u70b9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**\u81ea\u6211\u4fee\u590d** \u63a7\u5236\u5e73\u9762\u6301\u7eed\u76d1\u63a7\u6240\u6709\u8282\u70b9\u548c Pod\u3002\u5f53\u5bb9\u5668\u5d29\u6e83\u6216\u8282\u70b9\u6545\u969c\u65f6\uff0c\u81ea\u52a8\u91cd\u65b0\u8c03\u5ea6 Pod \u5230\u5065\u5eb7\u8282\u70b9\uff0c\u4fdd\u8bc1\u526f\u672c\u6570\u7b26\u5408\u671f\u671b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**\u6c34\u5e73\u6269\u7f29\u5bb9** \u652f\u6301\u624b\u52a8\u548c\u81ea\u52a8\uff08HPA\/VPA\uff09\u5bf9 Deployment\u3001StatefulSet \u7b49\u8d44\u6e90\u8fdb\u884c\u6269\u7f29\u5bb9\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u5de5\u4f5c\u6a21\u5f0f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Kubernetes \u96c6\u7fa4\u91c7\u7528 **\u591a Master + \u591a Worker** \u67b6\u6784\uff08N\u22651\uff09\uff0c\u6240\u6709\u7ec4\u4ef6\u901a\u8fc7 API Server \u901a\u4fe1\uff0c\u5404\u7ec4\u4ef6\u804c\u8d23\u5355\u4e00\u3001\u677e\u8026\u5408\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u7ec4\u4ef6\u67b6\u6784<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u63a7\u5236\u5e73\u9762\u7ec4\u4ef6\uff08Control Plane\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ba1\u7406\u96c6\u7fa4\u5168\u5c40\u72b6\u6001\uff0c\u901a\u5e38\u90e8\u7f72\u5728 Master \u8282\u70b9\u4e0a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**kube-apiserver** Kubernetes \u7684\u6838\u5fc3\u7f51\u5173\uff0c\u6240\u6709\u7ec4\u4ef6\u4ea4\u4e92\u7684\u552f\u4e00\u5165\u53e3\u3002\u5bf9\u5916\u66b4\u9732 RESTful HTTP API\uff0c\u8d1f\u8d23\u8ba4\u8bc1\u3001\u9274\u6743\u3001\u51c6\u5165\u63a7\u5236\u548c\u6570\u636e\u6301\u4e45\u5316\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**etcd** \u5177\u5907\u4e00\u81f4\u6027\u548c\u9ad8\u53ef\u7528\u7684\u5206\u5e03\u5f0f\u952e\u503c\u5b58\u50a8\uff0c\u4fdd\u5b58\u96c6\u7fa4\u6240\u6709\u914d\u7f6e\u6570\u636e\u548c\u72b6\u6001\u4fe1\u606f\u3002\u6240\u6709\u901a\u8fc7 API Server \u7684\u5199\u64cd\u4f5c\u6700\u7ec8\u90fd\u6301\u4e45\u5316\u5230 etcd\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**kube-scheduler** Watch API Server \u4e2d\u672a\u88ab\u8c03\u5ea6\u7684 Pod\uff0c\u6839\u636e\u8d44\u6e90\u9700\u6c42\u3001\u4eb2\u548c\u6027\u3001\u6c61\u70b9\u5bb9\u5fcd\u7b49\u7b56\u7565\u9009\u62e9\u5408\u9002\u7684 Worker \u8282\u70b9\uff0c\u5c06\u7ed1\u5b9a\u7ed3\u679c\u5199\u56de API Server\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**kube-controller-manager** \u8fd0\u884c\u4e00\u7ec4\u5185\u7f6e\u63a7\u5236\u5668\u7684\u96c6\u5408\uff08Deployment Controller\u3001Node Controller\u3001Endpoint Controller \u7b49\uff09\u3002\u6bcf\u4e2a\u63a7\u5236\u5668\u90fd\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u63a7\u5236\u5faa\u73af\uff0c\u6301\u7eed\u5c06\u8d44\u6e90\u5f53\u524d\u72b6\u6001\u5411\u671f\u671b\u72b6\u6001\u8c03\u8c10\uff08Reconcile\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**cloud-controller-manager\uff08\u53ef\u9009\uff09** \u4e0e\u4e91\u5e73\u53f0 API \u96c6\u6210\uff0c\u7528\u4e8e\u7ba1\u7406\u4e91\u8d44\u6e90\uff08\u5982\u8d1f\u8f7d\u5747\u8861\u5668\u3001\u4e91\u5b58\u50a8\u3001\u8282\u70b9\u81ea\u52a8\u53d1\u73b0\uff09\u3002\u4ec5\u5728\u4e91\u73af\u5883\u90e8\u7f72\u65f6\u9700\u8981\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Node \u7ec4\u4ef6<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd0\u884c\u5728\u6bcf\u4e2a Worker \u8282\u70b9\u4e0a\uff0c\u7ef4\u62a4 Pod \u8fd0\u884c\u73af\u5883\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**kubelet** \u8282\u70b9\u4e0a\u7684\u6838\u5fc3\u4ee3\u7406\u3002\u6839\u636e API Server \u4e0b\u53d1\u7684 PodSpec \u521b\u5efa\u3001\u542f\u52a8\u3001\u76d1\u63a7\u5bb9\u5668\uff0c\u5e76\u5b9a\u671f\u4e0a\u62a5\u8282\u70b9\u548c Pod \u72b6\u6001\u7ed9 API Server\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**kube-proxy** \u7ef4\u62a4\u8282\u70b9\u4e0a\u7684\u7f51\u7edc\u89c4\u5219\uff08iptables \u6216 IPVS \u6a21\u5f0f\uff09\uff0c\u5c06 Service \u7684 ClusterIP \u6d41\u91cf\u8f6c\u53d1\u5230\u540e\u7aef Pod\uff0c\u5b9e\u73b0 Service \u7684\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">**\u5bb9\u5668\u8fd0\u884c\u65f6\uff08Container Runtime\uff09** \u8d1f\u8d23\u5b9e\u9645\u8fd0\u884c\u5bb9\u5668\u7684\u5e95\u5c42\u8f6f\u4ef6\uff0c\u5982 containerd\u3001CRI-O \u7b49\uff0c\u9075\u5faa CRI\uff08Container Runtime Interface\uff09\u6807\u51c6\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u7ec4\u4ef6\u4ea4\u4e92\u6d41\u7a0b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u521b\u5efa\u4e00\u4e2a Pod \u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. \u7528\u6237\u901a\u8fc7 **kubectl** \u5411 **kube-apiserver** \u63d0\u4ea4 Pod \u521b\u5efa\u8bf7\u6c42 2. API Server \u9a8c\u8bc1\u8bf7\u6c42\u5408\u6cd5\u6027\uff0c\u5c06 Pod \u5bf9\u8c61\u6301\u4e45\u5316\u5230 **etcd** 3. **kube-scheduler** \u901a\u8fc7 watch \u673a\u5236\u53d1\u73b0\u672a\u88ab\u8c03\u5ea6\u7684 Pod\uff0c\u9009\u62e9\u6700\u4f18\u8282\u70b9\u540e\u5c06\u7ed1\u5b9a\u4fe1\u606f\u5199\u56de API Server 4. \u5bf9\u5e94\u8282\u70b9\u7684 **kubelet** watch \u5230\u5206\u914d\u7ed9\u81ea\u5df1\u7684 Pod\uff0c\u8c03\u7528\u5bb9\u5668\u8fd0\u884c\u65f6\u521b\u5efa\u5bb9\u5668 5. **kube-controller-manager** \u4e2d\u7684\u5404\u79cd\u63a7\u5236\u5668\u6301\u7eed\u76d1\u63a7\u8d44\u6e90\u72b6\u6001\uff0c\u5f53\u5b9e\u9645\u72b6\u6001\u504f\u79bb\u671f\u671b\u72b6\u6001\u65f6\u6267\u884c\u8c03\u8c10\u64cd\u4f5c<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5173\u952e\u539f\u5219\uff1a**\u6240\u6709\u7ec4\u4ef6\u53ea\u4e0e API Server \u901a\u4fe1\uff0c\u4e0d\u76f4\u63a5\u4e92\u76f8\u8c03\u7528** \u2014 API Server \u662f\u96c6\u7fa4\u552f\u4e00\u7684\"\u4fe1\u606f\u4e2d\u67a2\"\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b80\u8bb0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kubernetes\uff08K8s\uff09\u662f\u4e00\u4e2a\u751f\u4ea7\u7ea7\u7684\u5bb9\u5668\u7f16\u6392\u5e73\u53f0\uff0c\u63d0\u4f9b\u5206\u5e03\u5f0f\u7cfb\u7edf\u8fd0\u884c\u6240\u9700\u7684\u5f39\u6027\u4f38\u7f29\u3001\u6545\u969c\u8f6c\u79fb\u548c\u90e8\u7f72\u7ba1\u7406\u80fd\u529b\u3002\u5176\u6838\u5fc3\u80fd\u529b\u901a\u8fc7 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1691","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1691"}],"version-history":[{"count":1,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1691\/revisions"}],"predecessor-version":[{"id":1692,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1691\/revisions\/1692"}],"wp:attachment":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}