{"id":76739,"date":"2026-02-23T09:01:43","date_gmt":"2026-02-23T01:01:43","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/76739.html"},"modified":"2026-02-23T09:01:43","modified_gmt":"2026-02-23T01:01:43","slug":"%e3%80%90kubernetes%e3%80%91%ef%bc%88%e4%ba%8c%ef%bc%89k8s%e5%9f%ba%e7%a1%80","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/76739.html","title":{"rendered":"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"-toc\" style=\"margin-left:0px\">\n<p id=\"%E4%B8%80%E3%80%81Kubernetes%20%E9%9B%86%E7%BE%A4%E6%9E%B6%E6%9E%84%EF%BC%9A%E6%8E%A7%E5%88%B6%E5%B9%B3%E9%9D%A2%E4%B8%8E%E5%B7%A5%E4%BD%9C%E8%8A%82%E7%82%B9-toc\" style=\"margin-left:0px\">\u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&#xff1a;\u63a7\u5236\u5e73\u9762\u4e0e\u5de5\u4f5c\u8282\u70b9<\/p>\n<p id=\"1.%20%E6%8E%A7%E5%88%B6%E5%B9%B3%E9%9D%A2%E6%A0%B8%E5%BF%83%E7%BB%84%E4%BB%B6-toc\" style=\"margin-left:40px\">1. \u63a7\u5236\u5e73\u9762\u6838\u5fc3\u7ec4\u4ef6<\/p>\n<p id=\"2.%20%E5%B7%A5%E4%BD%9C%E8%8A%82%E7%82%B9%E6%A0%B8%E5%BF%83%E7%BB%84%E4%BB%B6-toc\" style=\"margin-left:40px\">2. \u5de5\u4f5c\u8282\u70b9\u6838\u5fc3\u7ec4\u4ef6<\/p>\n<p id=\"3.%20%E9%9B%86%E7%BE%A4%E5%B8%B8%E7%94%A8%E6%8F%92%E4%BB%B6-toc\" style=\"margin-left:40px\">3. \u96c6\u7fa4\u5e38\u7528\u63d2\u4ef6<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E6%A0%87%E7%AD%BE%E4%B8%8E%E9%80%89%E6%8B%A9%E7%AC%A6-toc\" style=\"margin-left:0px\">\u4e8c\u3001\u6807\u7b7e\u4e0e\u9009\u62e9\u7b26<\/p>\n<p id=\"1.%20%E6%A0%87%E7%AD%BE%EF%BC%88Labels%EF%BC%89-toc\" style=\"margin-left:40px\">1. \u6807\u7b7e&#xff08;Labels&#xff09;<\/p>\n<p id=\"%E6%A0%87%E7%AD%BE%E7%9A%84%E5%B8%B8%E8%A7%81%E7%94%A8%E9%80%94-toc\" style=\"margin-left:80px\">\u6807\u7b7e\u7684\u5e38\u89c1\u7528\u9014<\/p>\n<p id=\"%E6%A0%87%E7%AD%BE%E7%9A%84%E8%A7%84%E8%8C%83%E8%A6%81%E6%B1%82-toc\" style=\"margin-left:80px\">\u6807\u7b7e\u7684\u89c4\u8303\u8981\u6c42<\/p>\n<p id=\"2.%20%E6%A0%87%E7%AD%BE%E9%80%89%E6%8B%A9%E7%AC%A6%EF%BC%88Label%20Selectors%EF%BC%89-toc\" style=\"margin-left:40px\">2. \u6807\u7b7e\u9009\u62e9\u7b26&#xff08;Label Selectors&#xff09;<\/p>\n<p id=\"%E4%B8%A4%E7%A7%8D%E5%8C%B9%E9%85%8D%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:80px\">\u4e24\u79cd\u5339\u914d\u7c7b\u578b<\/p>\n<p id=\"%E5%AE%9E%E6%93%8D%E7%A4%BA%E4%BE%8B%EF%BC%88%E8%B4%B4%E5%90%88%E5%AE%9E%E9%99%85%E9%83%A8%E7%BD%B2%E5%9C%BA%E6%99%AF%EF%BC%89-toc\" style=\"margin-left:80px\">\u5b9e\u64cd\u793a\u4f8b&#xff08;\u8d34\u5408\u5b9e\u9645\u90e8\u7f72\u573a\u666f&#xff09;<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:0px\">\u4e09\u3001\u603b\u7ed3<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E4%B8%80%E3%80%81Kubernetes%20%E9%9B%86%E7%BE%A4%E6%9E%B6%E6%9E%84%EF%BC%9A%E6%8E%A7%E5%88%B6%E5%B9%B3%E9%9D%A2%E4%B8%8E%E5%B7%A5%E4%BD%9C%E8%8A%82%E7%82%B9\">\u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&#xff1a;\u63a7\u5236\u5e73\u9762\u4e0e\u5de5\u4f5c\u8282\u70b9<\/h2>\n<p>\u4e00\u4e2a\u5b8c\u6574\u7684Kubernetes\u96c6\u7fa4&#xff0c;\u672c\u8d28\u662f\u201c\u51b3\u7b56\u4e2d\u67a2&#043;\u6267\u884c\u7ec8\u7aef\u201d\u7684\u534f\u540c\u4f53\u7cfb&#xff0c;\u4e3b\u8981\u7531\u4e24\u5927\u6838\u5fc3\u90e8\u5206\u6784\u6210&#xff1a;\u63a7\u5236\u5e73\u9762&#xff08;Control Plane&#xff09; \u548c \u5de5\u4f5c\u8282\u70b9&#xff08;Worker Nodes&#xff09;&#xff0c;\u4e24\u8005\u5404\u53f8\u5176\u804c\u3001\u53cc\u5411\u901a\u4fe1&#xff0c;\u5171\u540c\u4fdd\u969c\u96c6\u7fa4\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n<p>\u63a7\u5236\u5e73\u9762&#xff1a;\u4f5c\u4e3a\u96c6\u7fa4\u7684\u201c\u5927\u8111\u201d&#xff0c;\u6838\u5fc3\u804c\u8d23\u662f\u505a\u51fa\u5168\u5c40\u51b3\u7b56&#xff08;\u5982Pod\u8c03\u5ea6\u3001\u8d44\u6e90\u5206\u914d&#xff09;&#xff0c;\u540c\u65f6\u5b9e\u65f6\u68c0\u6d4b\u96c6\u7fa4\u72b6\u6001\u3001\u54cd\u5e94\u5404\u7c7b\u5f02\u5e38\u4e8b\u4ef6&#xff08;\u5982Pod\u5d29\u6e83\u3001\u8282\u70b9\u6545\u969c&#xff09;\u3002\u4e3a\u4e86\u4fdd\u969c\u9ad8\u53ef\u7528\u6027&#xff0c;\u751f\u4ea7\u73af\u5883\u4e2d\u63a7\u5236\u5e73\u9762\u901a\u5e38\u90e8\u7f72\u5728\u591a\u53f0\u4e3b\u673a\u4e0a&#xff0c;\u907f\u514d\u5355\u70b9\u6545\u969c\u3002<\/p>\n<p>\u5de5\u4f5c\u8282\u70b9&#xff1a;\u4f5c\u4e3a\u96c6\u7fa4\u7684\u201c\u751f\u4ea7\u7ec8\u7aef\u201d&#xff0c;\u6838\u5fc3\u804c\u8d23\u662f\u627f\u8f7d\u8fd0\u884c\u5e94\u7528\u7684Pod&#xff08;\u5bb9\u5668\u7ec4&#xff09;&#xff0c;\u7ef4\u62a4\u5bb9\u5668\u8fd0\u884c\u65f6\u73af\u5883&#xff0c;\u540c\u65f6\u5b9e\u65f6\u5411\u63a7\u5236\u5e73\u9762\u4e0a\u62a5\u81ea\u8eab\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u548cPod\u8fd0\u884c\u72b6\u6001&#xff0c;\u63a5\u6536\u5e76\u6267\u884c\u63a7\u5236\u5e73\u9762\u4e0b\u53d1\u7684\u5404\u7c7b\u6307\u4ee4\u3002<\/p>\n<h3 id=\"1.%20%E6%8E%A7%E5%88%B6%E5%B9%B3%E9%9D%A2%E6%A0%B8%E5%BF%83%E7%BB%84%E4%BB%B6\">1. \u63a7\u5236\u5e73\u9762\u6838\u5fc3\u7ec4\u4ef6<\/h3>\n<p>\u63a7\u5236\u5e73\u9762\u7684\u201c\u51b3\u7b56\u80fd\u529b\u201d&#xff0c;\u4f9d\u8d56\u4e8e\u591a\u4e2a\u529f\u80fd\u72ec\u7acb\u3001\u534f\u540c\u5de5\u4f5c\u7684\u6838\u5fc3\u7ec4\u4ef6&#xff0c;\u6bcf\u4e2a\u7ec4\u4ef6\u90fd\u627f\u62c5\u7740\u7279\u5b9a\u7684\u804c\u8d23&#xff0c;\u5171\u540c\u6784\u6210\u96c6\u7fa4\u7684\u201c\u6307\u6325\u4f53\u7cfb\u201d&#xff1a;<\/p>\n<p>kube-apiserver&#xff1a;Kubernetes API\u7684\u7edf\u4e00\u524d\u7aef&#xff0c;\u662f\u96c6\u7fa4\u6240\u6709\u64cd\u4f5c\u7684\u552f\u4e00\u5165\u53e3\u3002\u65e0\u8bba\u662fkubectl\u547d\u4ee4\u884c\u64cd\u4f5c\u3001\u5de5\u4f5c\u8282\u70b9\u4e0a\u62a5\u72b6\u6001&#xff0c;\u8fd8\u662f\u5916\u90e8\u7cfb\u7edf\u8c03\u7528&#xff0c;\u90fd\u5fc5\u987b\u7ecf\u8fc7\u5b83\u7684\u8ba4\u8bc1\u3001\u6388\u6743\u548c\u9650\u6d41\u5904\u7406\u3002\u5b83\u652f\u6301\u6c34\u5e73\u6269\u5c55&#xff0c;\u53ef\u901a\u8fc7\u589e\u52a0\u5b9e\u4f8b\u6570\u91cf\u63d0\u5347\u5e76\u53d1\u5904\u7406\u80fd\u529b&#xff0c;\u662f\u6574\u4e2a\u96c6\u7fa4\u7684\u201c\u901a\u4fe1\u67a2\u7ebd\u201d\u3002<\/p>\n<p>etcd&#xff1a;\u96c6\u7fa4\u7684\u201c\u6838\u5fc3\u6570\u636e\u5e93\u201d&#xff0c;\u4e00\u6b3e\u9ad8\u53ef\u7528\u3001\u5f3a\u4e00\u81f4\u6027\u7684\u5206\u5e03\u5f0f\u952e\u503c\u5b58\u50a8\u7cfb\u7edf\u3002\u96c6\u7fa4\u5185\u6240\u6709\u72b6\u6001\u4fe1\u606f&#xff08;\u5982Pod\u914d\u7f6e\u3001\u8282\u70b9\u4fe1\u606f\u3001\u6807\u7b7e\u3001Service\u89c4\u5219\u7b49&#xff09;\u90fd\u7edf\u4e00\u5b58\u50a8\u5728etcd\u4e2d&#xff0c;\u4e14\u4ec5\u5141\u8bb8kube-apiserver\u76f4\u63a5\u8bfb\u5199&#xff0c;\u786e\u4fdd\u6570\u636e\u7684\u5b89\u5168\u6027\u548c\u4e00\u81f4\u6027\u3002<\/p>\n<p>kube-scheduler&#xff1a;\u96c6\u7fa4\u7684\u201c\u667a\u80fd\u8c03\u5ea6\u5458\u201d&#xff0c;\u8d1f\u8d23\u76d1\u63a7\u6240\u6709\u65b0\u521b\u5efa\u3001\u672a\u5206\u914d\u8282\u70b9\u7684Pod&#xff0c;\u7ed3\u5408\u591a\u79cd\u56e0\u7d20&#xff08;\u8282\u70b9CPU\/\u5185\u5b58\u5269\u4f59\u8d44\u6e90\u3001\u6807\u7b7e\u5339\u914d\u89c4\u5219\u3001\u4eb2\u548c\u6027\/\u53cd\u4eb2\u548c\u6027\u3001\u6c61\u70b9\u4e0e\u5bb9\u5fcd\u5ea6\u7b49&#xff09;&#xff0c;\u4e3a\u6bcf\u4e2aPod\u9009\u62e9\u6700\u5408\u9002\u7684\u5de5\u4f5c\u8282\u70b9&#xff0c;\u786e\u4fdd\u8d44\u6e90\u9ad8\u6548\u5229\u7528\u3002<\/p>\n<p>kube-controller-manager&#xff1a;\u96c6\u7fa4\u7684\u201c\u5f02\u5e38\u5de1\u68c0\u4e0e\u4fee\u590d\u7ba1\u5bb6\u201d&#xff0c;\u8fd0\u884c\u7740\u591a\u79cd\u63a7\u5236\u5668\u8fdb\u7a0b&#xff08;\u5982\u8282\u70b9\u63a7\u5236\u5668\u3001\u526f\u672c\u63a7\u5236\u5668\u3001EndpointSlice\u63a7\u5236\u5668\u3001Job\u63a7\u5236\u5668\u7b49&#xff09;\u3002\u6838\u5fc3\u804c\u8d23\u662f\u76d1\u63a7\u96c6\u7fa4\u201c\u5b9e\u9645\u72b6\u6001\u201d\u4e0e\u201c\u671f\u671b\u72b6\u6001\u201d\u7684\u5dee\u5f02&#xff0c;\u4e00\u65e6\u53d1\u73b0\u504f\u5dee&#xff08;\u5982Pod\u526f\u672c\u6570\u4e0d\u8db3\u3001\u8282\u70b9\u6545\u969c&#xff09;&#xff0c;\u7acb\u5373\u89e6\u53d1\u4fee\u590d\u64cd\u4f5c&#xff0c;\u4fdd\u969c\u96c6\u7fa4\u59cb\u7ec8\u7b26\u5408\u9884\u8bbe\u914d\u7f6e\u3002<\/p>\n<p>cloud-controller-manager&#xff1a;\u4e91\u73af\u5883\u4e13\u5c5e\u7684\u201c\u9002\u914d\u6865\u6881\u201d&#xff0c;\u5d4c\u5165\u4e86\u7279\u5b9a\u4e91\u5382\u5546&#xff08;\u5982\u963f\u91cc\u4e91\u3001\u817e\u8baf\u4e91\u3001AWS&#xff09;\u7684\u63a7\u5236\u903b\u8f91\u3002\u6838\u5fc3\u4f5c\u7528\u662f\u5c06Kubernetes\u96c6\u7fa4\u4e0e\u4e91\u63d0\u4f9b\u5546\u7684API\u5bf9\u63a5&#xff0c;\u5b9e\u73b0\u96c6\u7fa4\u4e0e\u4e91\u670d\u52a1\u7684\u8054\u52a8&#xff08;\u5982\u81ea\u52a8\u521b\u5efa\u4e91\u8d1f\u8f7d\u5747\u8861\u3001\u4e91\u78c1\u76d8&#xff09;&#xff0c;\u4ec5\u5728\u4e91\u73af\u5883\u90e8\u7f72\u7684\u96c6\u7fa4\u4e2d\u9700\u8981\u542f\u7528&#xff0c;\u79c1\u6709\u90e8\u7f72\u73af\u5883\u53ef\u5ffd\u7565\u3002<\/p>\n<h3 id=\"2.%20%E5%B7%A5%E4%BD%9C%E8%8A%82%E7%82%B9%E6%A0%B8%E5%BF%83%E7%BB%84%E4%BB%B6\">2. \u5de5\u4f5c\u8282\u70b9\u6838\u5fc3\u7ec4\u4ef6<\/h3>\n<p>\u5de5\u4f5c\u8282\u70b9\u7684\u201c\u6267\u884c\u80fd\u529b\u201d&#xff0c;\u4f9d\u8d56\u4e8e\u90e8\u7f72\u5728\u6bcf\u4e2a\u8282\u70b9\u4e0a\u76843\u4e2a\u6838\u5fc3\u7ec4\u4ef6&#xff0c;\u5b83\u4eec\u8d1f\u8d23\u5c06\u63a7\u5236\u5e73\u9762\u7684\u201c\u51b3\u7b56\u6307\u4ee4\u201d\u843d\u5730\u4e3a\u5b9e\u9645\u7684\u5bb9\u5668\u8fd0\u884c\u64cd\u4f5c&#xff1a;<\/p>\n<p>kubelet&#xff1a;\u63a7\u5236\u5e73\u9762\u5728\u5de5\u4f5c\u8282\u70b9\u4e0a\u7684\u201c\u4e13\u5c5e\u4ee3\u7406\u201d&#xff0c;\u8fd0\u884c\u5728\u6bcf\u4e00\u4e2a\u5de5\u4f5c\u8282\u70b9\u4e0a\u3002\u6838\u5fc3\u804c\u8d23\u662f\u76d1\u542ckube-apiserver\u4e0b\u53d1\u7684\u6307\u4ee4&#xff0c;\u786e\u4fddPod\u89c4\u8303\u4e2d\u63cf\u8ff0\u7684\u6240\u6709\u5bb9\u5668\u6b63\u5e38\u8fd0\u884c\u3001\u5904\u4e8e\u5065\u5eb7\u72b6\u6001&#xff1b;\u540c\u65f6\u5b9a\u671f\u91c7\u96c6\u8282\u70b9\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5&#xff08;CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8&#xff09;\u548cPod\u8fd0\u884c\u72b6\u6001&#xff0c;\u4e0a\u62a5\u7ed9\u63a7\u5236\u5e73\u9762&#xff0c;\u662f\u8fde\u63a5\u63a7\u5236\u5e73\u9762\u4e0e\u5de5\u4f5c\u8282\u70b9\u7684\u201c\u6865\u6881\u201d\u3002<\/p>\n<p>kube-proxy&#xff1a;\u5de5\u4f5c\u8282\u70b9\u7684\u201c\u7f51\u7edc\u8c03\u5ea6\u5458\u201d&#xff0c;\u8d1f\u8d23\u7ef4\u62a4\u8282\u70b9\u4e0a\u7684\u7f51\u7edc\u89c4\u5219&#xff08;\u57fa\u4e8eiptables\u6216IPVS&#xff09;\u3002\u6838\u5fc3\u4f5c\u7528\u662f\u5b9e\u73b0Kubernetes Service\u7684\u901a\u4fe1\u8f6c\u53d1\u548c\u8d1f\u8f7d\u5747\u8861\u2014\u2014\u5b9e\u65f6\u76d1\u63a7Service\u548cPod\u7684\u53d8\u5316&#xff0c;\u66f4\u65b0\u7f51\u7edc\u89c4\u5219&#xff0c;\u5c06\u5916\u90e8\u8bf7\u6c42\u6216\u96c6\u7fa4\u5185\u5176\u4ed6Pod\u7684\u8bf7\u6c42&#xff0c;\u5747\u5300\u8f6c\u53d1\u5230\u540e\u7aef\u5bf9\u5e94\u7684\u591a\u4e2aPod\u4e0a&#xff0c;\u907f\u514d\u5355\u70b9\u8fc7\u8f7d\u3002<\/p>\n<p>\u5bb9\u5668\u8fd0\u884c\u65f6&#xff08;CRI&#xff09;&#xff1a;\u5bb9\u5668\u7684\u201c\u751f\u547d\u5468\u671f\u7ba1\u7406\u5668\u201d&#xff0c;\u8d1f\u8d23\u5904\u7406\u5bb9\u5668\u7684\u521b\u5efa\u3001\u542f\u52a8\u3001\u505c\u6b62\u3001\u9500\u6bc1\u7b49\u5168\u751f\u547d\u5468\u671f\u64cd\u4f5c&#xff0c;\u662fKubernetes\u4e0e\u5bb9\u5668\u4e4b\u95f4\u7684\u6807\u51c6\u5316\u63a5\u53e3&#xff08;CRI&#xff0c;Container Runtime Interface&#xff09;\u3002\u5e38\u89c1\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\u5305\u62eccontainerd\u3001CRI-O\u7b49&#xff0c;\u65e9\u671f\u5e38\u7528\u7684Docker&#xff0c;\u672c\u8d28\u4e5f\u662f\u901a\u8fc7\u9002\u914dCRI\u63a5\u53e3\u63a5\u5165K8s&#xff0c;\u76ee\u524d\u5df2\u9010\u6b65\u88ab\u66f4\u8f7b\u91cf\u7684containerd\u66ff\u4ee3\u3002<\/p>\n<h3 id=\"3.%20%E9%9B%86%E7%BE%A4%E5%B8%B8%E7%94%A8%E6%8F%92%E4%BB%B6\">3. \u96c6\u7fa4\u5e38\u7528\u63d2\u4ef6<\/h3>\n<p>\u9664\u4e86\u6838\u5fc3\u7ec4\u4ef6&#xff0c;Kubernetes\u96c6\u7fa4\u8fd8\u9700\u8981\u4f9d\u8d56\u5404\u7c7b\u63d2\u4ef6&#xff0c;\u5b9e\u73b0\u96c6\u7fa4\u7ea7\u7684\u6269\u5c55\u529f\u80fd\u3002\u8fd9\u4e9b\u63d2\u4ef6\u901a\u5e38\u901a\u8fc7K8s\u81ea\u8eab\u7684\u8d44\u6e90&#xff08;\u5982DaemonSet\u3001Deployment&#xff09;\u90e8\u7f72&#xff0c;\u4e0e\u6838\u5fc3\u7ec4\u4ef6\u534f\u540c\u5de5\u4f5c&#xff0c;\u5b8c\u5584\u96c6\u7fa4\u80fd\u529b&#xff1a;<\/p>\n<p>\u7f51\u7edc\u4e0e\u7b56\u7565\u63d2\u4ef6&#xff1a;\u5982Calico\u3001Flannel\u3001Weave\u7b49&#xff0c;\u8d1f\u8d23\u5b9e\u73b0\u96c6\u7fa4\u5185Pod\u4e4b\u95f4\u7684\u7f51\u7edc\u8fde\u901a\u6027&#xff0c;\u540c\u65f6\u63d0\u4f9b\u7f51\u7edc\u7b56\u7565\u7ba1\u7406&#xff08;\u5982\u9650\u5236Pod\u95f4\u7684\u8bbf\u95ee\u6743\u9650&#xff09;&#xff0c;\u662f\u96c6\u7fa4\u7f51\u7edc\u901a\u4fe1\u7684\u57fa\u7840\u3002<\/p>\n<p>\u670d\u52a1\u53d1\u73b0\u63d2\u4ef6&#xff1a;\u6700\u5e38\u7528\u7684\u662fCoreDNS&#xff0c;\u4f5c\u4e3a\u96c6\u7fa4\u5185\u7684DNS\u670d\u52a1\u5668&#xff0c;\u8d1f\u8d23\u89e3\u6790Pod\u548cService\u7684\u57df\u540d&#xff0c;\u5b9e\u73b0\u670d\u52a1\u53d1\u73b0&#xff08;\u5982Pod\u901a\u8fc7Service\u57df\u540d\u8bbf\u95ee\u540e\u7aef\u670d\u52a1&#xff09;\u3002<\/p>\n<p>\u53ef\u89c6\u5316\u4e0e\u63a7\u5236\u63d2\u4ef6&#xff1a;\u5982Kubernetes Dashboard&#xff0c;\u63d0\u4f9bWeb UI\u63a7\u5236\u53f0&#xff0c;\u652f\u6301\u901a\u8fc7\u56fe\u5f62\u5316\u754c\u9762\u67e5\u770b\u96c6\u7fa4\u72b6\u6001\u3001\u64cd\u4f5cPod\u548cService&#xff0c;\u964d\u4f4e\u8fd0\u7ef4\u95e8\u69db\u3002<\/p>\n<p>\u57fa\u7840\u8bbe\u65bd\u63d2\u4ef6&#xff1a;\u5982KubeVirt&#xff0c;\u5141\u8bb8\u5728Kubernetes\u96c6\u7fa4\u4e0a\u76f4\u63a5\u8fd0\u884c\u865a\u62df\u673a&#xff0c;\u5b9e\u73b0\u201c\u5bb9\u5668&#043;\u865a\u62df\u673a\u201d\u7684\u6df7\u5408\u90e8\u7f72&#xff0c;\u9002\u914d\u66f4\u591a\u4e1a\u52a1\u573a\u666f\u3002<\/p>\n<h2 id=\"%E4%BA%8C%E3%80%81%E6%A0%87%E7%AD%BE%E4%B8%8E%E9%80%89%E6%8B%A9%E7%AC%A6\">\u4e8c\u3001\u6807\u7b7e\u4e0e\u9009\u62e9\u7b26<\/h2>\n<p>Kubernetes\u96c6\u7fa4\u4e2d&#xff0c;\u4f1a\u5b58\u5728\u5927\u91cf\u7684Pod\u3001Node\u3001Service\u7b49\u8d44\u6e90\u5bf9\u8c61&#xff0c;\u5982\u4f55\u9ad8\u6548\u5730\u5bf9\u8fd9\u4e9b\u8d44\u6e90\u8fdb\u884c\u5206\u7c7b\u3001\u7b5b\u9009\u3001\u8c03\u5ea6\u548c\u7ba1\u7406&#xff1f;\u6838\u5fc3\u5c31\u5728\u4e8e \u6807\u7b7e&#xff08;Labels&#xff09; \u548c \u9009\u62e9\u7b26&#xff08;Selectors&#xff09; \u2014\u2014\u5b83\u4eec\u662fK8s\u5b9e\u73b0\u670d\u52a1\u53d1\u73b0\u3001Pod\u8c03\u5ea6\u3001\u6279\u91cf\u64cd\u4f5c\u7684\u6838\u5fc3\u673a\u5236&#xff0c;\u7b80\u5355\u4e14\u7075\u6d3b\u3002<\/p>\n<h3 id=\"1.%20%E6%A0%87%E7%AD%BE%EF%BC%88Labels%EF%BC%89\">1. \u6807\u7b7e&#xff08;Labels&#xff09;<\/h3>\n<p>\u6807\u7b7e\u662f\u9644\u52a0\u5728Kubernetes\u6240\u6709\u8d44\u6e90\u5bf9\u8c61&#xff08;\u5982Pod\u3001Node\u3001Service\u3001Deployment&#xff09;\u4e0a\u7684\u952e\u503c\u5bf9&#xff08;key&#061;value&#xff09;&#xff0c;\u672c\u8eab\u4e0d\u5f71\u54cd\u8d44\u6e90\u7684\u529f\u80fd\u8fd0\u884c&#xff0c;\u4ec5\u7528\u4e8e\u5bf9\u8d44\u6e90\u8fdb\u884c\u6807\u8bb0\u3001\u5206\u7c7b\u548c\u8bc6\u522b&#xff0c;\u76f8\u5f53\u4e8e\u7ed9\u8d44\u6e90\u8d34\u4e0a\u201c\u8eab\u4efd\u6807\u7b7e\u201d\u3002<\/p>\n<h4 id=\"%E6%A0%87%E7%AD%BE%E7%9A%84%E5%B8%B8%E8%A7%81%E7%94%A8%E9%80%94\">\u6807\u7b7e\u7684\u5e38\u89c1\u7528\u9014<\/h4>\n<p>\u670d\u52a1\u53d1\u73b0\u4e0e\u8def\u7531&#xff1a;Service\u901a\u8fc7\u6807\u7b7e\u9009\u62e9\u7b26&#xff0c;\u5339\u914d\u5230\u5bf9\u5e94\u7684Pod&#xff0c;\u5b9e\u73b0\u6d41\u91cf\u8def\u7531&#xff08;\u5982\u5c06\u8bf7\u6c42\u8f6c\u53d1\u5230\u6240\u6709\u5e26\u6709\u201capp&#061;nginx\u201d\u6807\u7b7e\u7684Pod&#xff09;\u3002<\/p>\n<p>\u8d44\u6e90\u5206\u7c7b\u4e0e\u73af\u5883\u9694\u79bb&#xff1a;\u901a\u8fc7\u6807\u7b7e\u533a\u5206\u4e0d\u540c\u73af\u5883\u3001\u4e0d\u540c\u4e1a\u52a1\u3001\u4e0d\u540c\u7248\u672c\u7684\u8d44\u6e90&#xff0c;\u5982\u7528\u201cenv&#061;dev\u201d\u6807\u8bb0\u5f00\u53d1\u73af\u5883\u8d44\u6e90\u3001\u201cenv&#061;prod\u201d\u6807\u8bb0\u751f\u4ea7\u73af\u5883\u8d44\u6e90&#xff0c;\u201capp&#061;nginx\u201d\u6807\u8bb0Nginx\u76f8\u5173\u8d44\u6e90&#xff0c;\u201cversion&#061;v1.0\u201d\u6807\u8bb01.0\u7248\u672c\u7684\u8d44\u6e90\u3002<\/p>\n<p>\u6279\u91cf\u64cd\u4f5c\u4e0e\u7ba1\u7406&#xff1a;\u901a\u8fc7\u6807\u7b7e\u7b5b\u9009\u51fa\u4e00\u7ec4\u8d44\u6e90&#xff0c;\u6267\u884c\u6279\u91cf\u64cd\u4f5c&#xff08;\u5982\u6279\u91cf\u5220\u9664\u6240\u6709\u5e26\u6709\u201cversion&#061;v1.0\u201d\u6807\u7b7e\u7684Pod&#xff0c;\u6279\u91cf\u66f4\u65b0\u6240\u6709\u5e26\u6709\u201cenv&#061;test\u201d\u6807\u7b7e\u7684Deployment&#xff09;\u3002<\/p>\n<h4 id=\"%E6%A0%87%E7%AD%BE%E7%9A%84%E8%A7%84%E8%8C%83%E8%A6%81%E6%B1%82\">\u6807\u7b7e\u7684\u89c4\u8303\u8981\u6c42<\/h4>\n<p>\u4e3a\u4e86\u786e\u4fdd\u6807\u7b7e\u7684\u53ef\u7528\u6027\u548c\u4e00\u81f4\u6027&#xff0c;K8s\u5bf9\u6807\u7b7e\u7684\u952e&#xff08;key&#xff09;\u548c\u503c&#xff08;value&#xff09;\u6709\u660e\u786e\u89c4\u8303&#xff1a;<\/p>\n<p>\u952e\u540d&#xff1a;\u5fc5\u987b\u4ee5\u5b57\u6bcd&#xff08;a-z\u3001A-Z&#xff09;\u6216\u6570\u5b57&#xff08;0-9&#xff09;\u5f00\u5934\u548c\u7ed3\u5c3e&#xff0c;\u4e2d\u95f4\u53ef\u5305\u542b\u8fde\u5b57\u7b26&#xff08;-&#xff09;\u3001\u4e0b\u5212\u7ebf&#xff08;_&#xff09;\u3001\u53e5\u70b9&#xff08;.&#xff09;&#xff1b;\u53ef\u9009\u524d\u7f00&#xff08;\u5982\u201capp.kubernetes.io\/name\u201d&#xff09;\u5fc5\u987b\u662f\u5408\u6cd5\u7684DNS\u5b50\u57df\u540d\u3002<\/p>\n<p>\u503c&#xff1a;\u957f\u5ea6\u4e0d\u8d85\u8fc763\u4e2a\u5b57\u7b26&#xff0c;\u53ef\u4e3a\u7a7a&#xff1b;\u540c\u6837\u4ee5\u5b57\u6bcd\u6216\u6570\u5b57\u5f00\u5934\u548c\u7ed3\u5c3e&#xff0c;\u4e2d\u95f4\u53ef\u5305\u542b\u8fde\u5b57\u7b26\u3001\u4e0b\u5212\u7ebf\u3001\u53e5\u70b9\u3002<\/p>\n<h3 id=\"2.%20%E6%A0%87%E7%AD%BE%E9%80%89%E6%8B%A9%E7%AC%A6%EF%BC%88Label%20Selectors%EF%BC%89\">2. \u6807\u7b7e\u9009\u62e9\u7b26&#xff08;Label Selectors&#xff09;<\/h3>\n<p>\u6807\u7b7e\u9009\u62e9\u7b26\u662fKubernetes\u5ba2\u6237\u7aef&#xff08;\u5982kube-scheduler\u3001Service\u3001kubectl&#xff09;\u8bc6\u522b\u548c\u7b5b\u9009\u4e00\u7ec4\u8d44\u6e90\u7684\u6838\u5fc3\u5de5\u5177&#xff0c;\u672c\u8d28\u662f\u201c\u6839\u636e\u6807\u7b7e\u7684\u952e\u503c\u5bf9&#xff0c;\u5339\u914d\u7b26\u5408\u6761\u4ef6\u7684\u8d44\u6e90\u5bf9\u8c61\u201d\u3002\u5b83\u652f\u6301\u4e24\u79cd\u5e38\u7528\u5339\u914d\u7c7b\u578b&#xff0c;\u53ef\u7075\u6d3b\u7ec4\u5408\u4f7f\u7528&#xff1a;<\/p>\n<h4 id=\"%E4%B8%A4%E7%A7%8D%E5%8C%B9%E9%85%8D%E7%B1%BB%E5%9E%8B\">\u4e24\u79cd\u5339\u914d\u7c7b\u578b<\/h4>\n<p>\u57fa\u4e8e\u7b49\u503c\u5339\u914d&#xff1a;\u5339\u914d\u6807\u7b7e\u952e\u503c\u5bf9\u5b8c\u5168\u76f8\u7b49\u6216\u4e0d\u76f8\u7b49\u7684\u8d44\u6e90&#xff0c;\u5e38\u7528\u7b26\u53f7&#xff1a;&#061;&#xff08;\u76f8\u7b49&#xff09;\u3001!&#061;&#xff08;\u4e0d\u76f8\u7b49&#xff09;\u3002 \u793a\u4f8b&#xff1a;\u201cenvironment&#061;production\u201d&#xff08;\u5339\u914d\u6240\u6709\u6807\u7b7e\u4e3aenvironment&#061;production\u7684\u8d44\u6e90&#xff09;\u3001\u201ctier!&#061;frontend\u201d&#xff08;\u5339\u914d\u6240\u6709\u6807\u7b7etier\u4e0d\u7b49\u4e8efrontend\u7684\u8d44\u6e90&#xff09;\u3002<\/p>\n<p>\u57fa\u4e8e\u96c6\u5408\u5339\u914d&#xff1a;\u5339\u914d\u6807\u7b7e\u503c\u5c5e\u4e8e\u67d0\u4e2a\u96c6\u5408\u6216\u4e0d\u5c5e\u4e8e\u67d0\u4e2a\u96c6\u5408\u7684\u8d44\u6e90&#xff0c;\u5e38\u7528\u7b26\u53f7&#xff1a;in&#xff08;\u5c5e\u4e8e&#xff09;\u3001notin&#xff08;\u4e0d\u5c5e\u4e8e&#xff09;\u3001!&#xff08;\u4e0d\u5b58\u5728\u8be5\u6807\u7b7e\u952e&#xff09;\u3002 \u793a\u4f8b&#xff1a;\u201cenvironment in (production, qa)\u201d&#xff08;\u5339\u914d\u6807\u7b7eenvironment\u4e3aproduction\u6216qa\u7684\u8d44\u6e90&#xff09;\u3001\u201ctier notin (frontend, backend)\u201d&#xff08;\u5339\u914d\u6807\u7b7etier\u4e0d\u5c5e\u4e8efrontend\u548cbackend\u7684\u8d44\u6e90&#xff09;\u3001\u201c!partition\u201d&#xff08;\u5339\u914d\u6ca1\u6709partition\u6807\u7b7e\u7684\u8d44\u6e90&#xff09;\u3002<\/p>\n<h4 id=\"%E5%AE%9E%E6%93%8D%E7%A4%BA%E4%BE%8B%EF%BC%88%E8%B4%B4%E5%90%88%E5%AE%9E%E9%99%85%E9%83%A8%E7%BD%B2%E5%9C%BA%E6%99%AF%EF%BC%89\">\u5b9e\u64cd\u793a\u4f8b&#xff08;\u8d34\u5408\u5b9e\u9645\u90e8\u7f72\u573a\u666f&#xff09;<\/h4>\n<p>\u7ed9Pod\u5b9a\u4e49\u6807\u7b7e \u5728Pod\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u901a\u8fc7metadata.labels\u5b57\u6bb5\u5b9a\u4e49\u6807\u7b7e&#xff0c;\u6807\u8bb0Pod\u7684\u73af\u5883\u548c\u5e94\u7528\u7c7b\u578b&#xff1a;<\/p>\n<p>apiVersion: v1<br \/>\nkind: Pod<br \/>\nmetadata:<br \/>\n  name: label-demo-pod<br \/>\n  labels:<br \/>\n    environment: production  # \u6807\u8bb0\u73af\u5883\u4e3a\u751f\u4ea7\u73af\u5883<br \/>\n    app: nginx               # \u6807\u8bb0\u5e94\u7528\u4e3anginx<br \/>\n    version: v1.14.2         # \u6807\u8bb0\u5e94\u7528\u7248\u672c<br \/>\nspec:<br \/>\n  containers:<br \/>\n  &#8211; name: nginx-container<br \/>\n    image: nginx:1.14.2<br \/>\n    ports:<br \/>\n    &#8211; containerPort: 80  # \u5bb9\u5668\u5185\u90e8\u7aef\u53e3 <\/p>\n<p>\u4f7f\u7528nodeSelector\u8c03\u5ea6Pod\u200b\u901a\u8fc7nodeSelector\u6807\u7b7e\u9009\u62e9\u7b26&#xff0c;\u8ba9Pod\u53ea\u8c03\u5ea6\u5230\u5e26\u6709\u7279\u5b9a\u6807\u7b7e\u7684\u5de5\u4f5c\u8282\u70b9\u4e0a&#xff08;\u5982GPU\u8282\u70b9\u3001\u9ad8\u6027\u80fd\u8282\u70b9&#xff09;&#xff0c;\u5b9e\u73b0\u7cbe\u51c6\u8c03\u5ea6&#xff1a;<\/p>\n<p>apiVersion: v1<br \/>\nkind: Pod<br \/>\nmetadata:<br \/>\n  name: gpu-demo-pod<br \/>\n  labels:<br \/>\n    app: gpu-test<br \/>\nspec:<br \/>\n  nodeSelector:<br \/>\n    accelerator: nvidia-tesla-p100  # \u53ea\u8c03\u5ea6\u5230\u5e26\u6709\u8be5\u6807\u7b7e\u7684\u8282\u70b9<br \/>\n  containers:<br \/>\n  &#8211; name: gpu-container<br \/>\n    image: nvidia\/cuda:11.0.3-base-ubuntu20.04<br \/>\n    command: [&#034;sleep&#034;, &#034;3600&#034;] <\/p>\n<p>kubectl\u547d\u4ee4\u884c\u4f7f\u7528\u6807\u7b7e\u7b5b\u9009\u200b\u901a\u8fc7kubectl\u547d\u4ee4&#xff0c;\u7ed3\u5408\u6807\u7b7e\u9009\u62e9\u7b26\u7b5b\u9009\u8d44\u6e90&#xff0c;\u5b9e\u73b0\u6279\u91cf\u64cd\u4f5c&#xff1a;<\/p>\n<p># \u7b5b\u9009\u6240\u6709\u751f\u4ea7\u73af\u5883\u7684nginx Pod<br \/>\nkubectl get pods -l environment&#061;production,app&#061;nginx<\/p>\n<p># \u6279\u91cf\u5220\u9664\u6240\u6709v1.0\u7248\u672c\u7684Pod<br \/>\nkubectl delete pods -l version&#061;v1.0 <\/p>\n<h2 id=\"%E4%B8%89%E3%80%81%E6%80%BB%E7%BB%93\">\u4e09\u3001\u603b\u7ed3<\/h2>\n<p>Kubernetes\u7684\u8bbe\u8ba1\u54f2\u5b66&#xff0c;\u6838\u5fc3\u662f\u201c\u89e3\u8026\u201d\u4e0e\u201c\u53ef\u6269\u5c55\u201d&#xff1a;\u63a7\u5236\u5e73\u9762\u4e0e\u5de5\u4f5c\u8282\u70b9\u5206\u79bb&#xff0c;\u5b9e\u73b0\u201c\u51b3\u7b56\u4e0e\u6267\u884c\u201d\u7684\u89e3\u8026&#xff0c;\u4fdd\u969c\u96c6\u7fa4\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u6269\u5c55\u6027&#xff1b;\u63a7\u5236\u5e73\u9762\u5185\u90e8\u7ec4\u4ef6\u5404\u53f8\u5176\u804c\u3001\u534f\u540c\u5de5\u4f5c&#xff0c;\u5de5\u4f5c\u8282\u70b9\u7ec4\u4ef6\u4e13\u6ce8\u6267\u884c&#xff0c;\u4efb\u4f55\u7ec4\u4ef6\u6545\u969c\u90fd\u53ef\u72ec\u7acb\u66ff\u6362&#xff0c;\u4e0d\u5f71\u54cd\u6574\u4f53\u96c6\u7fa4\u529f\u80fd\u3002<\/p>\n<p>\u800c\u6807\u7b7e\u4e0e\u9009\u62e9\u7b26&#xff0c;\u5219\u4e3a\u8fd9\u79cd\u89e3\u8026\u67b6\u6784\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u8d44\u6e90\u7ba1\u7406\u65b9\u5f0f\u2014\u2014\u65e0\u9700\u4fee\u6539\u8d44\u6e90\u672c\u8eab\u7684\u914d\u7f6e&#xff0c;\u4ec5\u901a\u8fc7\u6807\u7b7e\u6807\u8bb0\u548c\u9009\u62e9\u7b26\u7b5b\u9009&#xff0c;\u5c31\u80fd\u5b9e\u73b0\u8d44\u6e90\u7684\u5206\u7c7b\u3001\u8c03\u5ea6\u3001\u670d\u52a1\u53d1\u73b0\u548c\u6279\u91cf\u64cd\u4f5c&#xff0c;\u9002\u914d\u590d\u6742\u591a\u53d8\u7684\u4e1a\u52a1\u573a\u666f\u3002<\/p>\n<p>\u7406\u89e3\u4e86\u8fd9\u4e9b\u6838\u5fc3\u6982\u5ff5&#xff0c;\u5c31\u638c\u63e1\u4e86Kubernetes\u7684\u201c\u9aa8\u67b6\u201d\u548c\u201c\u903b\u8f91\u201d\u3002\u540e\u7eed\u5b66\u4e60Deployment\u3001StatefulSet\u3001Service\u7b49\u66f4\u590d\u6742\u7684\u8d44\u6e90\u5bf9\u8c61\u65f6&#xff0c;\u5c31\u80fd\u6e05\u6670\u5730\u77e5\u9053\u8fd9\u4e9b\u8d44\u6e90\u5982\u4f55\u4e0e\u96c6\u7fa4\u7ec4\u4ef6\u4ea4\u4e92\u3001\u5982\u4f55\u901a\u8fc7\u6807\u7b7e\u5b9e\u73b0\u5173\u8054&#xff0c;\u4ece\u800c\u66f4\u9ad8\u6548\u5730\u8bbe\u8ba1\u3001\u90e8\u7f72\u548c\u8fd0\u7ef4Kubernetes\u5e94\u7528&#xff0c;\u8ba9\u8fd9\u4e2a\u5f3a\u5927\u7684\u5bb9\u5668\u7f16\u6392\u5e73\u53f0\u771f\u6b63\u4e3a\u4e1a\u52a1\u8d4b\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55 \u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&#xff1a;\u63a7\u5236\u5e73\u9762\u4e0e\u5de5\u4f5c\u8282\u70b9<br \/>\n1. \u63a7\u5236\u5e73\u9762\u6838\u5fc3\u7ec4\u4ef6<br \/>\n2. \u5de5\u4f5c\u8282\u70b9\u6838\u5fc3\u7ec4\u4ef6<br \/>\n3. \u96c6\u7fa4\u5e38\u7528\u63d2\u4ef6<br \/>\n\u4e8c\u3001\u6807\u7b7e\u4e0e\u9009\u62e9\u7b26<br \/>\n1. \u6807\u7b7e&#xff08;Labels&#xff09;<br \/>\n\u6807\u7b7e\u7684\u5e38\u89c1\u7528\u9014<br \/>\n\u6807\u7b7e\u7684\u89c4\u8303\u8981\u6c42<br \/>\n2. \u6807\u7b7e\u9009\u62e9\u7b26&#xff08;Label Selectors&#xff09;<br \/>\n\u4e24\u79cd\u5339\u914d\u7c7b\u578b<br \/>\n\u5b9e\u64cd\u793a\u4f8b&#xff08;\u8d34\u5408\u5b9e\u9645\u90e8\u7f72\u573a\u666f&#xff09;<br \/>\n\u4e09\u3001\u603b\u7ed3 \u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&amp;#xff1<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1493,58,763],"topic":[],"class_list":["post-76739","post","type-post","status-publish","format-standard","hentry","category-server","tag-k8s","tag-linux","tag-763"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/76739.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&#xff1a;\u63a7\u5236\u5e73\u9762\u4e0e\u5de5\u4f5c\u8282\u70b9 1. \u63a7\u5236\u5e73\u9762\u6838\u5fc3\u7ec4\u4ef6 2. \u5de5\u4f5c\u8282\u70b9\u6838\u5fc3\u7ec4\u4ef6 3. \u96c6\u7fa4\u5e38\u7528\u63d2\u4ef6 \u4e8c\u3001\u6807\u7b7e\u4e0e\u9009\u62e9\u7b26 1. \u6807\u7b7e&#xff08;Labels&#xff09; \u6807\u7b7e\u7684\u5e38\u89c1\u7528\u9014 \u6807\u7b7e\u7684\u89c4\u8303\u8981\u6c42 2. \u6807\u7b7e\u9009\u62e9\u7b26&#xff08;Label Selectors&#xff09; \u4e24\u79cd\u5339\u914d\u7c7b\u578b \u5b9e\u64cd\u793a\u4f8b&#xff08;\u8d34\u5408\u5b9e\u9645\u90e8\u7f72\u573a\u666f&#xff09; \u4e09\u3001\u603b\u7ed3 \u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&amp;#xff1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/76739.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-23T01:01:43+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/76739.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/76739.html\",\"name\":\"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-23T01:01:43+00:00\",\"dateModified\":\"2026-02-23T01:01:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/76739.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/76739.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/76739.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/76739.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&#xff1a;\u63a7\u5236\u5e73\u9762\u4e0e\u5de5\u4f5c\u8282\u70b9 1. \u63a7\u5236\u5e73\u9762\u6838\u5fc3\u7ec4\u4ef6 2. \u5de5\u4f5c\u8282\u70b9\u6838\u5fc3\u7ec4\u4ef6 3. \u96c6\u7fa4\u5e38\u7528\u63d2\u4ef6 \u4e8c\u3001\u6807\u7b7e\u4e0e\u9009\u62e9\u7b26 1. \u6807\u7b7e&#xff08;Labels&#xff09; \u6807\u7b7e\u7684\u5e38\u89c1\u7528\u9014 \u6807\u7b7e\u7684\u89c4\u8303\u8981\u6c42 2. \u6807\u7b7e\u9009\u62e9\u7b26&#xff08;Label Selectors&#xff09; \u4e24\u79cd\u5339\u914d\u7c7b\u578b \u5b9e\u64cd\u793a\u4f8b&#xff08;\u8d34\u5408\u5b9e\u9645\u90e8\u7f72\u573a\u666f&#xff09; \u4e09\u3001\u603b\u7ed3 \u4e00\u3001Kubernetes \u96c6\u7fa4\u67b6\u6784&amp;#xff1","og_url":"https:\/\/www.wsisp.com\/helps\/76739.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-23T01:01:43+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/76739.html","url":"https:\/\/www.wsisp.com\/helps\/76739.html","name":"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-23T01:01:43+00:00","dateModified":"2026-02-23T01:01:43+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/76739.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/76739.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/76739.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Kubernetes\u3011\uff08\u4e8c\uff09k8s\u57fa\u7840"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/76739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=76739"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/76739\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=76739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=76739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=76739"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=76739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}