{"id":4917,"date":"2021-09-29T10:24:14","date_gmt":"2021-09-29T02:24:14","guid":{"rendered":"http:\/\/blog.ywdevops.cn\/?p=4917"},"modified":"2025-05-30T17:34:40","modified_gmt":"2025-05-30T09:34:40","slug":"k8s-zj","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2021\/09\/29\/k8s-zj\/","title":{"rendered":"k8s\u5e38\u89c1\u7ec4\u4ef6\u539f\u7406"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>API\u5c42\uff1a\u4e3b\u8981\u4ee5REST\u65b9\u5f0f\u63d0\u4f9b\u5404\u79cdAPI\u63a5\u53e3\uff0c\u9664\u4e86\u6709Kubernetes\u8d44\u6e90\u5bf9\u8c61\u7684CRUD\u548cWatch\u7b49\u4e3b\u8981API\u8fd8\u6709\u5065\u5eb7\u68c0\u67e5\u3001UI\u3001\u65e5\u5fd7\u3001\u6027\u80fd\u6307\u6807\u7b49\u8fd0\u7ef4\u76d1\u63a7\u76f8\u5173\u7684API\u3002Kubernetes\u4ece1.11\u7248\u672c\u5f00\u59cb\u5e9f\u5f03Heapster\u76d1\u63a7\u7ec4\u4ef6\uff0c\u8f6c\u800c\u4f7f\u7528Metrics Server\u63d0\u4f9bMetrics API\u63a5\u53e3\uff0c\u8fdb\u4e00\u6b65\u5b8c\u5584\u4e86\u81ea\u8eab\u7684\u76d1\u63a7\u80fd\u529b\u3002<\/li><li>\u8bbf\u95ee\u63a7\u5236\u5c42\uff1a\u5f53\u5ba2\u6237\u7aef\u8bbf\u95eeAPI\u63a5\u53e3\u65f6\uff0c\u8bbf\u95ee\u63a7\u5236\u5c42\u8d1f\u8d23\u5bf9\u7528\u6237\u8eab\u4efd\u9274\u6743\uff0c\u9a8c\u660e\u7528\u6237\u8eab\u4efd\uff0c\u6838\u51c6\u7528\u6237\u5bf9Kubernetes\u8d44\u6e90\u5bf9\u8c61\u7684\u8bbf\u95ee \u6743 \u9650 \uff0c \u7136 \u540e \u6839 \u636e \u914d \u7f6e \u7684 \u5404 \u79cd \u8d44 \u6e90 \u8bbf \u95ee \u8bb8 \u53ef \u903b \u8f91 \uff08 AdmissionControl\uff09\uff0c\u5224\u65ad\u662f\u5426\u5141\u8bb8\u8bbf\u95ee\u3002<\/li><li>\u6ce8\u518c\u8868\u5c42\uff1aKubernetes\u628a\u6240\u6709\u8d44\u6e90\u5bf9\u8c61\u90fd\u4fdd\u5b58\u5728\u6ce8\u518c\u8868\uff08Registry\uff09\u4e2d\uff0c\u9488\u5bf9\u6ce8\u518c\u8868\u4e2d\u7684\u5404\u79cd\u8d44\u6e90\u5bf9\u8c61\u90fd\u5b9a\u4e49\u4e86\u8d44\u6e90\u5bf9\u8c61\u7684\u7c7b\u578b\u3001\u5982\u4f55\u521b\u5efa\u8d44\u6e90\u5bf9\u8c61\u3001\u5982\u4f55\u8f6c\u6362\u8d44\u6e90\u7684\u4e0d\u540c\u7248\u672c\uff0c\u4ee5\u53ca\u5982\u4f55\u5c06\u8d44\u6e90\u7f16\u7801\u548c\u89e3\u7801\u4e3aJSON\u6216ProtoBuf\u683c\u5f0f\u8fdb\u884c\u5b58\u50a8\u3002<\/li><li>etcd\u6570\u636e\u5e93\uff1a\u7528\u4e8e\u6301\u4e45\u5316\u5b58\u50a8Kubernetes\u8d44\u6e90\u5bf9\u8c61\u7684KV\u6570\u636e\u5e93\u3002etcd\u7684Watch API\u63a5\u53e3\u5bf9\u4e8eAPI Server\u6765\u8bf4\u81f3\u5173\u91cd\u8981\uff0c\u56e0\u4e3a\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\uff0cAPI Server\u521b\u65b0\u6027\u5730\u8bbe\u8ba1\u4e86List-Watch\u8fd9\u79cd\u9ad8\u6027\u80fd\u7684\u8d44\u6e90\u5bf9\u8c61\u5b9e\u65f6\u540c\u6b65\u673a\u5236\uff0c\u4f7fKubernetes\u53ef\u4ee5\u7ba1\u7406\u8d85\u5927\u89c4\u6a21\u7684\u96c6\u7fa4\uff0c\u53ca\u65f6\u54cd\u5e94\u548c\u5feb\u901f\u5904\u7406\u96c6\u7fa4\u4e2d\u7684\u5404\u79cd\u4e8b\u4ef6\u3002<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"622\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/18.png\" alt=\"\" class=\"wp-image-6331\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/18.png 707w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/18-300x264.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/18-600x528.png 600w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b8c\u6574\u7684\u8c03\u5ea6\u673a\u5236\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"406\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/19.png\" alt=\"\" class=\"wp-image-6333\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/19.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/19-300x172.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/01\/19-600x344.png 600w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Pod\u521b\u5efa\u6d41\u7a0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7528\u6237\u901a\u8fc7kubectl\u6216\u8005\u5176\u4ed6\u7684API\u5ba2\u6237\u7aef\u63d0\u4ea4PodSpec\u7ed9API Server<\/li><li>API Server \u5c06pod\u7684\u4fe1\u606f\u5b58\u5165\u5230etcd\u4e2d\uff0c\u5e76\u8fd4\u56de\u786e\u8ba4\u4fe1\u606f\u7ed9\u5ba2\u6237\u7aef<\/li><li>controller\u901a\u8fc7list-watch\u673a\u5236\uff0c\u68c0\u67e5\u53d1\u73b0\u65b0\u7684deployment\uff0c\u5c06\u8d44\u6e90\u52a0\u5165\u5230\u5185\u90e8\u961f\u5217\u4e2d\uff0c\u542f\u52a8deployment controller\u521b\u5efareplicaset\u8d44\u6e90\uff0c\u5728\u542f\u7528replicaset controller\u521b\u5efapod<\/li><li>\u6240\u6709\u7684controller\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u5c06deployment,replicaset,pod\u7b49\u4fe1\u606f\u66f4\u65b0\u5230etcd\u4e2d<\/li><li>scheduler\u901a\u8fc7list-warch\u673a\u5236\u53d1\u73b0\u65b0\u7684Pod\uff0c\u6839\u636e\u4e00\u7cfb\u5217\u7684\u8c03\u5ea6\u89c4\u5219\uff0c\u5c06pod\u8c03\u5ea6\u5230\u6307\u5b9a\u8282\u70b9<\/li><li>\u5c06\u7ed1\u5b9a\u7ed3\u679c\u5b58\u50a8\u5230etcd\u4e2d<\/li><li>kubelet\u5468\u671f\u6027\u7684\u5411apiserver\u901a\u8fc7NodeName\u83b7\u53d6\u81ea\u8eabNode\u4e0a\u8981\u8fd0\u884c\u7684pod\u6e05\u5355\uff0c\u5e76\u8fd0\u884cpod<\/li><li>kube-proxy\u4e3a\u65b0\u521b\u5efa\u7684pod\u6ce8\u518c\u52a8\u6001DNS\u5230CoreDns\uff0c\u7ed9pod\u7684Service\u6dfb\u52a0iptables\/ipvs\u89c4\u5219<\/li><li>controller\u901a\u8fc7controller loop\u5c06\u5f53\u524dpod\u72b6\u6001\u4e0e\u7528\u6237\u671f\u671b\u7684\u72b6\u6001\u505a\u5bf9\u6bd4\uff0c\u5e76\u4fee\u6539\u4e3a\u671f\u671b\u72b6\u6001<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>API\u5c42\uff1a\u4e3b\u8981\u4ee5REST\u65b9\u5f0f\u63d0\u4f9b\u5404\u79cdAPI\u63a5\u53e3\uff0c\u9664\u4e86\u6709Kubernetes\u8d44\u6e90\u5bf9\u8c61\u7684CRUD\u548cWatch\u7b49\u4e3b\u8981 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":4918,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93,23],"tags":[],"class_list":["post-4917","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kubernetes","category-rong"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/4917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=4917"}],"version-history":[{"count":7,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/4917\/revisions"}],"predecessor-version":[{"id":10946,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/4917\/revisions\/10946"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/4918"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}