{"id":17364,"date":"2025-05-19T10:55:00","date_gmt":"2025-05-19T02:55:00","guid":{"rendered":"https:\/\/92it.top\/?p=17364"},"modified":"2025-07-03T22:15:02","modified_gmt":"2025-07-03T14:15:02","slug":"%e8%af%95%e4%ba%86%e8%af%95docker%e6%a1%8c%e9%9d%a2%e5%ba%94%e7%94%a8%e8%87%aa%e5%b8%a6%e7%9a%84k8s%e9%9b%86%e7%be%a4%ef%bc%8c%e4%b8%80%e4%b8%aa%e5%ad%97%e7%ae%80%e5%8d%95","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=17364","title":{"rendered":"Docker Desktop \u5b89\u88c5K8s\u96c6\u7fa4"},"content":{"rendered":"\n<p>\u8f6c\u8f7d\uff1a<a href=\"https:\/\/zhuanlan.zhihu.com\/p\/388874530\">https:\/\/zhuanlan.zhihu.com\/p\/388874530<\/a><\/p>\n\n\n\n<p><strong>\u524d\u8a00<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4e4b\u524d\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u8fc7\u51e0\u79cd\u5728\u7b14\u8bb0\u672c\u7535\u8111\u4e0a\u5b89\u88c5Kubernetes\u96c6\u7fa4\u7684\u5de5\u5177\uff0c\u867d\u7136\u5b89\u88c5\u8d77\u6765\u4e0d\u592a\u7e41\u7410\u4f46\u662f\u591a\u591a\u5c11\u5c11\u8fd8\u662f\u9700\u8981\u82b1\u4e00\u4e9b\u65f6\u95f4\u7684\uff0c\u5bf9\u4e8e\u4e0d\u60f3\u778e\u5012\u817e\uff0c\u5c31\u60f3\u5feb\u901f\u5b89\u88c5\u4e2a\u672c\u5730\u96c6\u7fa4\u5f00\u59cb\u5b66\u4e60\u548c\u6d4b\u8bd5\u7684\u540c\u5b66\uff0c\u63a8\u8350\u4f60\u4eec\u8bd5\u4e00\u8bd5Docker\u684c\u9762\u5e94\u7528\u91cc\u81ea\u5e26\u7684Kubernetes\u96c6\u7fa4\u3002\u5176\u5b9e\u6211\u4e5f\u662f\u4e4b\u524d\u7528Minikube\u5b89\u88c5\u7684\u96c6\u7fa4\u83ab\u540d\u5176\u5999\u574f\u6389\u542f\u52a8\u4e0d\u8d77\u6765\u540e\uff0c\u5076\u7136\u53d1\u73b0Docker\u684c\u9762\u5e94\u7528\u91cc\u5185\u5d4c\u4e86\u4e00\u4e2aKubernetes\u96c6\u7fa4\uff0c\u8bd5\u4e86\u8bd5\u6548\u679c\u611f\u89c9\u8fd8\u662f\u633a\u4e0d\u9519\u7684\u3002\u4e0b\u9762\u6211\u5e26\u5927\u5bb6\u7b80\u5355\u8fc7\u4e00\u4e0b\u542f\u7528\u96c6\u7fa4\u65b9\u6cd5\uff0c\u5168\u7a0b\u51e0\u4e4e\u5c31\u662f\u70b9\u70b9\u70b9\uff0c\u4e5f\u4e0d\u9700\u8981\u505a\u5565\u3002<\/p>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<p><strong>\u542f\u7528Kubernetes<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4e5f\u4e0d\u77e5\u9053\u662f\u4ec0\u4e48\u65f6\u5019\u5f00\u59cb\uff08\u53cd\u6b63\u8001\u65e9\u5c31\u6709\u4e86\uff0c\u6211\u8fd9\u4e2a\u662f\u524d\u5e74\u88c5\u7684&#8230;\u4e00\u76f4\u6ca1\u5347\u7ea7\u8fc7\uff09\uff0cDocker\u7684\u684c\u9762\u5e94\u7528\u9664\u4e86\u63d0\u4f9bDocker CLI\u96c6\u6210\u5916\u8fd8\u5185\u5d4c\u4e86\u4e00\u4e2aKubernetes\u96c6\u7fa4\uff0c\u9ed8\u8ba4\u662f\u4e0d\u5f00\u542f\u7684\uff0c\u542f\u7528\u540e\u8fd9\u4e2a\u5355\u70b9\u7684Kubernetes\u96c6\u7fa4\u4f1a\u8fd0\u884c\u5728\u672c\u5730\u7684Docker\u5b9e\u4f8b\u4e2d\u3002<\/p>\n\n\n\n<p>\u8981\u542f\u7528\u8fd9\u4e2a\u96c6\u7fa4\u53ea\u9700\u8981\u6253\u5f00Docker\u5e94\u7528\u7684\u9996\u9009\u9879\uff08Preferences\uff09\u754c\u9762\uff0c\u9009\u62e9Kubernetes\u9009\u9879\u5361\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"574\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-1024x574.png\" alt=\"\" class=\"wp-image-17365\" style=\"width:508px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-1024x574.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-300x168.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-768x430.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-830x465.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-230x129.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-350x196.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30-480x269.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-30.png 1314w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u70b9\u51fb\u5e94\u7528\u5e76\u91cd\u542f\uff0c\u5c31\u53ef\u4ee5\u53bb\u5237\u5c0f\u89c6\u9891\u4e86\uff0c\u518d\u56de\u6765\u96c6\u7fa4\u5c31\u5b89\u88c5\u597d\u4e86\u3002<\/p>\n\n\n\n<p>\u9664\u4e86\u542f\u7528Kubernetes\u96c6\u7fa4\u5916\uff0c\u5982\u679c\u7535\u8111\u4e0a\u4e4b\u524d\u6ca1\u6709\u5b89\u88c5\u8fc7 kubectl\uff08\u5ba2\u6237\u7aef\u547d\u4ee4\u5de5\u5177\uff09\u7684\u8bdd\u8fd8\u4f1a\u4e3a\u4f60\u81ea\u52a8\u5b89\u88c5\u4e0akubectl\uff0c\u5e76\u914d\u7f6e\u8fde\u63a5\u5230\u521a\u624d\u542f\u52a8\u7684\u672c\u5730\u96c6\u7fa4\u4e0a\u3002\u5982\u679c\u662f\u672c\u5730\u4e4b\u524d\u5b89\u88c5\u8fc7kubectl \u548c \u5b58\u5728\u5176\u4ed6Kubernetes\u96c6\u7fa4\uff0c\u60f3\u8981\u8fde\u63a5\u5230Docker\u684c\u9762\u5e94\u7528\u5185\u5d4c\u7684\u96c6\u7fa4\u5219\u9700\u8981\u5207\u6362\u4e00\u4e0b kubectl \u7684\u4e0a\u4e0b\u6587\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ kubectl config get-contexts\n$ kubectl config use-context docker-desktop<\/pre>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<p><strong>\u4f7f\u7528Kubernetes<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u96c6\u7fa4\u542f\u7528\u5b8c\u6210\u540e\uff0c\u5728\u6253\u5f00Docker\u684c\u9762\u5e94\u7528\u7684\u9009\u9879\u5361\u5728 UI \u4e0a\u4f1a\u6709\u4e9b\u5fae\u7684\u53d8\u5316\uff0c\u8bc1\u660e<code>Kubernetes<\/code>\u96c6\u7fa4\u5df2\u7ecf\u6210\u529f\u542f\u52a8\u8d77\u6765\u4e86\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-1024x583.png\" alt=\"\" class=\"wp-image-17366\" style=\"width:514px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-1024x583.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-300x171.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-768x438.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-830x473.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-230x131.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-350x199.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31-480x273.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-31.png 1320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u8ba9\u6211\u4eec\u968f\u4fbf\u8fd0\u884c\u51e0\u4e2a kubctl \u547d\u4ee4\uff0c\u8bd5\u8bd5\u6548\u679c\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u279c  ~ kubectl get node                     \nNAME             STATUS   ROLES                  AGE   VERSION\ndocker-desktop   Ready    control-plane,master   13d   v1.21.1<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\u6211\u4eec\u73b0\u5728\u4f7f\u7528\u7684\u662f\u4e00\u4e2a\u5355\u8282\u70b9\uff0c\u540d\u5b57\u53ebdocker-desktop\u7684\u96c6\u7fa4\uff08\u8fd9\u4e2a\u540d\u6ca1\u5730\u65b9\u6539\uff09\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528Docker\u684c\u9762\u5e94\u7528\u81ea\u5e26\u7684Kubernetes\u96c6\u7fa4\u8fd8\u6709\u4e00\u70b9\u65b9\u4fbf\u7684\u5730\u65b9\u5c31\u662f\uff0c\u96c6\u7fa4\u5916\u90e8\u901a\u8fc7 127.0.0.1 \u5c31\u80fd\u8bbf\u95ee\u96c6\u7fa4\u5185\u90e8\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u901a\u8fc7 NodePort\u7c7b\u578b\u7684 Service \u5411\u96c6\u7fa4\u5916\u66b4\u9732\u7684\u8d44\u6e90\uff0c\u901a\u8fc7 127.0.0.1:port \u7684\u5f62\u5f0f\u5c31\u80fd\u8bbf\u95ee\u5230\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u968f\u4fbf\u62ff\u4e00\u4e2a\u4e4b\u524d\u6211\u4eec\u642d\u5efaMySQL\u5f00\u53d1\u73af\u5883\u7684\u4f8b\u5b50\u6d4b\u8bd5\u4e00\u4e0b\u3002\u642d\u5efaMySQL\u9700\u8981\u7684YAML\u5b9a\u4e49\u6587\u4ef6\u548c\u6b65\u9aa4\u6211\u5c31\u4e0d\u518d\u91cd\u590d\u8bf4\u4e86\uff0c\u5fd8\u8bb0\u7684\u540c\u5b66\u4e4b\u524d\u8bbf\u95ee\u4e0a\u4e00\u7bc7\u6587\u7ae0\uff1a<a href=\"https:\/\/link.zhihu.com\/?target=http%3A\/\/mp.weixin.qq.com\/s%3F__biz%3DMzUzNTY5MzU2MA%3D%3D%26mid%3D2247487453%26idx%3D1%26sn%3D4d9ae57ea9079a7cb57d84672b29491a%26chksm%3Dfa80de4acdf7575cb9f6ced3a5657c48434d881cbbf694392efe79e4961d353b1f49975b223b%26token%3D1138464917%26lang%3Dzh_CN%23rd\" target=\"_blank\" rel=\"noreferrer noopener\">\u5229\u7528Kubernetes\u642d\u5efa\u4fbf\u643a\u5f0f\u5f00\u53d1\u73af\u5883\u4e4bMySQL\u548cRedis<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">## \u5207\u5230\u5b9a\u4e49\u6587\u4ef6\u5728\u7684\u76ee\u5f55\nkubectl apply -f mysql-configmap.yaml\n\nkubectl apply -f deployment-service.yaml\n\n--------------------------------------------------------\n## \u53ef\u4ee5\u770b\u5230\u4e0b\u9762\u7684Pod\u548cService\u8d44\u6e90\nkubectl get pod\n\nNAME                    READY   STATUS    RESTARTS   AGE\nmysql-cc4479465-gwdj7   1\/1     Running   0          13d\n--------------------------------------------------------\nkubectl get svc mysql\nNAME    TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE\nmysql   NodePort   10.104.123.151   &lt;none>        3306:30306\/TCP   13d<\/pre>\n\n\n\n<p>\u5728\u7535\u8111\u4e0a\u53ea\u8981\u901a\u8fc7127.0.0.1:30306\u5c31\u80fd\u8bbf\u95ee\u5230\u6211\u4eec\u521a\u521a\u5b89\u88c5\u7684MySQL\u5566\uff0c\u6301\u4e45\u5316\u4e4b\u7c7b\u7684\u4e8b\u60c5\u6211\u4e5f\u8bd5\u8fc7\uff0c\u53ea\u8981\u6211\u4eec\u4e0d\u4e3b\u52a8\u628aMySQL\u8fd9\u4e2aPod\u5220\u6389\u6570\u636e\u5c31\u4f1a\u4e00\u76f4\u5728\u3002<\/p>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<p><strong>\u5b89\u88c5 dashboard<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>\u203c\ufe0f\u91cd\u8981\uff1adashboard\u542f\u52a8\u9700\u8981\u79d1\u5b66\u4e0a\u7f51\uff0c\u539f\u56e0\u662f\u4e0d\u79d1\u5b66\u4e0a\u7f51\u6709\u4e9b\u955c\u50cf\u62c9\u53d6\u4e0d\u4e0b\u6765\uff1f<\/strong><\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u203c\ufe0f\u91cd\u8981\uff1a\u5982\u679c\u8fd0\u884c\u65f6\u53d1\u73b0dashboard \u7684\u76f8\u5173\u670d\u52a1\u8d77\u4e0d\u6765\u4e86\uff0cdashboard\u6253\u4e0d\u5f00\uff0c\u6682\u65f6\u89e3\u51b3\u65b9\u6cd5\u662f\uff0c\u6302vpn\u7ffb\u5899\uff0c\u7136\u540e\u91cd\u542f docker desktop\u670d\u52a1\u3002<\/mark><\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"572\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-1024x572.png\" alt=\"\" class=\"wp-image-17373\" style=\"width:538px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-1024x572.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-300x168.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-768x429.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-830x463.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-230x128.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-350x195.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34-480x268.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-34.png 1259w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<ul>\n<li>k8s\u96c6\u7fa4\u542f\u52a8\u4ee5\u540e\uff0c\u5c31\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u786e\u8ba4\u96c6\u7fa4\u662f\u5426ready<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Mac-mini ~ % kubectl get node\nNAME             STATUS   ROLES           AGE    VERSION\ndocker-desktop   Ready    control-plane   2d2h   v1.32.2<\/pre>\n\n\n\n<ul>\n<li>\u63a5\u7740\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5 Kubernetes Dashboard\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl apply -f https:\/\/raw.githubusercontent.com\/kubernetes\/dashboard\/v2.7.0\/aio\/deploy\/recommended.yaml<\/pre>\n\n\n\n<ul>\n<li>\u521b\u5efa\u670d\u52a1\u8d26\u6237<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">admin-user.yaml\n\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: admin-user\n  namespace: kubernetes-dashboard<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl apply -f admin-user.yaml \n\n\u8f93\u51fa\uff1a\nserviceaccount\/admin-user created<\/pre>\n\n\n\n<ul>\n<li>\u7ed1\u5b9a\u670d\u52a1\u8d26\u6237\u96c6\u7fa4\u89d2\u8272<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">admin-user-role-binding.yaml\n\napiVersion: rbac.authorization.k8s.io\/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: admin-user\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: cluster-admin\nsubjects:\n- kind: ServiceAccount\n  name: admin-user\n  namespace: kubernetes-dashboard\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl apply -f admin-user-role-binding.yaml \n\n\u8f93\u51fa\uff1a\nclusterrolebinding.rbac.authorization.k8s.io\/admin-user created<\/pre>\n\n\n\n<ul>\n<li>\u521b\u5efa <code>admin-user<\/code> \u7684 token(\u8fd9\u4e2atoken\u597d\u50cf\u4f1a\u8fc7\u671f\uff0c\u5982\u679c\u8fc7\u671f\u7684\u8bdd\uff0c\u5c31\u7528\u4e0b\u9762\u547d\u4ee4\u91cd\u65b0\u521b\u5efa\u4e2a)<\/li>\n<\/ul>\n\n\n\n<p>Kubernetes \u4ece 1.24 \u7248\u672c\u5f00\u59cb\uff0c\u9ed8\u8ba4\u542f\u7528<code>ServiceAccount<\/code>\u4ee4\u724c\u7684\u81ea\u52a8\u7ba1\u7406\uff0c\u751f\u6210\u7684 Token \u9ed8\u8ba4\u6709\u6548\u671f\u4e3a<strong>1 \u5c0f\u65f6<\/strong>\uff08<code>3600\u79d2<\/code>\uff09\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl -n kubernetes-dashboard create token admin-user<\/pre>\n\n\n\n<ul>\n<li>\u521b\u5efa\u6c38\u4e45 Token\uff08\u4e0d\u63a8\u8350\uff0c\u5b58\u5728\u5b89\u5168\u98ce\u9669\uff09<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u901a\u8fc7Secret\u624b\u52a8\u521b\u5efa\u4e0d\u6307\u5b9a\u8fc7\u671f\u65f6\u95f4\u7684 Token\uff1a\n\napiVersion: v1\nkind: Secret\nmetadata:\n  name: admin-user-permanent-token\n  namespace: kubernetes-dashboard\n  annotations:\n    kubernetes.io\/service-account.name: \"admin-user\"  # \u5173\u8054ServiceAccount\ntype: kubernetes.io\/service-account-token\n\n\u5e94\u7528\u8be5 Secret \u540e\uff0c\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u83b7\u53d6 Token\uff1a\n\u8be5 Token \u65e0\u8fc7\u671f\u65f6\u95f4\uff0c\u9700\u624b\u52a8\u5220\u9664 Secret \u624d\u80fd\u5931\u6548\u3002\n\u751f\u4ea7\u73af\u5883\u4e2d\u5e94\u907f\u514d\u4f7f\u7528\u6c38\u4e45 Token\uff0c\u5efa\u8bae\u901a\u8fc7 RBAC \u63a7\u5236\u6743\u9650\u5e76\u5b9a\u671f\u8f6e\u6362\u77ed\u671f Token\u3002\nkubectl get secret admin-user-permanent-token -n kubernetes-dashboard -o jsonpath=\"{.data.token}\" | base64 -d<\/pre>\n\n\n\n<ul>\n<li>\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u542f\u52a8 dashboard<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl proxy --port=8001<\/pre>\n\n\n\n<ul>\n<li>\u7528\u4e0b\u9762\u7684url\u8bbf\u95ee dashboard<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">http:\/\/localhost:8001\/api\/v1\/namespaces\/kubernetes-dashboard\/services\/https:kubernetes-dashboard:\/proxy\/#\/login<\/pre>\n\n\n\n<ul>\n<li>\u8f93\u5165\u521a\u521a\u521b\u5efa\u7684 <code>admin-user<\/code> \u7684 token, \u7136\u540e\u767b\u5f55\u5c31\u53ef\u4ee5\u8bbf\u95eedashboard\u4e86<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"437\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-1024x437.png\" alt=\"\" class=\"wp-image-17374\" style=\"width:572px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-1024x437.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-300x128.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-768x328.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-1536x656.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-2048x875.png 2048w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-830x355.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-230x98.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-350x150.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-35-480x205.png 480w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"501\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-1024x501.png\" alt=\"\" class=\"wp-image-17376\" style=\"width:570px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-1024x501.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-300x147.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-768x376.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-1536x752.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-2048x1003.png 2048w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-830x406.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-230x113.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-350x171.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-37-480x235.png 480w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>dashboard \u91cd\u542f\u65f6 \u955c\u50cf\u62c9\u53d6\u4e0d\u4e86\u7684\u89e3\u51b3\u529e\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubernetes-dashboard     dashboard-metrics-scraper-5bd45c9dd6-q4wml              1\/1     Running            22 (16m ago)    43d\nkubernetes-dashboard     kubernetes-dashboard-79cbcf9fb6-bvj58                   0\/1     ImagePullBackOff   0               92s\nkubernetes-dashboard     kubernetes-dashboard-api-7b6b887946-76ncg               1\/1     Running            32 (16m ago)    43d\nkubernetes-dashboard     kubernetes-dashboard-auth-769bf978b9-tnc8m              1\/1     Running            22 (16m ago)    43d\nkubernetes-dashboard     kubernetes-dashboard-kong-65548bdf66-drm48              0\/1     Running            13 (5m9s ago)   5d5h\nkubernetes-dashboard     kubernetes-dashboard-metrics-scraper-76df4956c4-k64r9   1\/1     Running            22 (16m ago)    43d\nkubernetes-dashboard     kubernetes-dashboard-web-56df7655d9-rx7hh               1\/1     Running            22 (16m ago)    43d\nwechat-applet-services   service-notification-deployment-54bdd8655c-45tpm        1\/1     Running            8 (16m ago)     20d\nwechat-applet-services   service-task-executor-deployment-698cd9547-wvbvs        1\/1     Running            5 (16m ago)     7d7h\nwechat-applet-services   service-thumbnail-deployment-59b4f4759d-8qjbd           1\/1     Running            4 (16m ago)     6d\nwechat-applet-services   service-wechat-deployment-7f497855df-6rg9v              1\/1     Running            2 (16m ago)     5d21h\n\nkubectl logs kubernetes-dashboard-79cbcf9fb6-bvj58 -n kubernetes-dashboard\nError from server (BadRequest): container \"kubernetes-dashboard\" in pod \"kubernetes-dashboard-79cbcf9fb6-bvj58\" is waiting to start: trying and failing to pull image<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230 kubernetes-dashboard-79cbcf9fb6-bvj58 \u8fd9\u4e2apod\u8d77\u4e0d\u6765\uff0c\u955c\u50cf\u62c9\u53d6\u5931\u8d25\u3002<\/p>\n\n\n\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u8be5 Pod \u7684\u8be6\u7ec6\u914d\u7f6e\uff0c\u91cd\u70b9\u5173\u6ce8\u955c\u50cf\u76f8\u5173\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get pod kubernetes-dashboard-79cbcf9fb6-bvj58 -n kubernetes-dashboard -o yaml\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get pod kubernetes-dashboard-79cbcf9fb6-bvj58 -n kubernetes-dashboard -o yaml\n\napiVersion: v1\nkind: Pod\nmetadata:\n  creationTimestamp: \"2025-07-03T12:48:56Z\"\n  generateName: kubernetes-dashboard-79cbcf9fb6-\n  labels:\n    k8s-app: kubernetes-dashboard\n    pod-template-hash: 79cbcf9fb6\n  name: kubernetes-dashboard-79cbcf9fb6-bvj58\n  namespace: kubernetes-dashboard\n  ownerReferences:\n  - apiVersion: apps\/v1\n    blockOwnerDeletion: true\n    controller: true\n    kind: ReplicaSet\n    name: kubernetes-dashboard-79cbcf9fb6\n    uid: 5d718a39-36d4-45ca-8f82-7e5b18c58cd0\n  resourceVersion: \"5231806\"\n  uid: 42a3f595-2356-4a79-9010-60e3285e98e6\nspec:\n  containers:\n  - args:\n    - --auto-generate-certificates\n    - --namespace=kubernetes-dashboard\n    image: kubernetesui\/dashboard:v2.7.0\n    imagePullPolicy: Always\n    livenessProbe:\n      failureThreshold: 3\n      httpGet:\n        path: \/\n        port: 8443\n        scheme: HTTPS\n      initialDelaySeconds: 30\n      periodSeconds: 10\n      successThreshold: 1\n      timeoutSeconds: 30\n    name: kubernetes-dashboard\n    ports:\n    - containerPort: 8443\n      protocol: TCP\n    resources: {}\n    securityContext:\n      allowPrivilegeEscalation: false\n      readOnlyRootFilesystem: true\n      runAsGroup: 2001\n      runAsUser: 1001\n    terminationMessagePath: \/dev\/termination-log\n    terminationMessagePolicy: File\n    volumeMounts:\n    - mountPath: \/certs\n      name: kubernetes-dashboard-certs\n    - mountPath: \/tmp\n      name: tmp-volume\n    - mountPath: \/var\/run\/secrets\/kubernetes.io\/serviceaccount\n      name: kube-api-access-7pk9w\n      readOnly: true\n  dnsPolicy: ClusterFirst\n  enableServiceLinks: true\n  nodeName: docker-desktop\n  nodeSelector:\n    kubernetes.io\/os: linux\n  preemptionPolicy: PreemptLowerPriority\n  priority: 0\n  restartPolicy: Always\n  schedulerName: default-scheduler\n  securityContext:\n    seccompProfile:\n      type: RuntimeDefault\n  serviceAccount: kubernetes-dashboard\n  serviceAccountName: kubernetes-dashboard\n  terminationGracePeriodSeconds: 30\n  tolerations:\n  - effect: NoSchedule\n    key: node-role.kubernetes.io\/master\n  - effect: NoExecute\n    key: node.kubernetes.io\/not-ready\n    operator: Exists\n    tolerationSeconds: 300\n  - effect: NoExecute\n    key: node.kubernetes.io\/unreachable\n    operator: Exists\n    tolerationSeconds: 300\n  volumes:\n  - name: kubernetes-dashboard-certs\n    secret:\n      defaultMode: 420\n      secretName: kubernetes-dashboard-certs\n  - emptyDir: {}\n    name: tmp-volume\n  - name: kube-api-access-7pk9w\n    projected:\n      defaultMode: 420\n      sources:\n      - serviceAccountToken:\n          expirationSeconds: 3607\n          path: token\n      - configMap:\n          items:\n          - key: ca.crt\n            path: ca.crt\n          name: kube-root-ca.crt\n      - downwardAPI:\n          items:\n          - fieldRef:\n              apiVersion: v1\n              fieldPath: metadata.namespace\n            path: namespace\nstatus:\n  conditions:\n  - lastProbeTime: null\n    lastTransitionTime: \"2025-07-03T12:49:26Z\"\n    status: \"True\"\n    type: PodReadyToStartContainers\n  - lastProbeTime: null\n    lastTransitionTime: \"2025-07-03T12:48:56Z\"\n    status: \"True\"\n    type: Initialized\n  - lastProbeTime: null\n    lastTransitionTime: \"2025-07-03T12:48:56Z\"\n    message: 'containers with unready status: [kubernetes-dashboard]'\n    reason: ContainersNotReady\n    status: \"False\"\n    type: Ready\n  - lastProbeTime: null\n    lastTransitionTime: \"2025-07-03T12:48:56Z\"\n    message: 'containers with unready status: [kubernetes-dashboard]'\n    reason: ContainersNotReady\n    status: \"False\"\n    type: ContainersReady\n  - lastProbeTime: null\n    lastTransitionTime: \"2025-07-03T12:48:56Z\"\n    status: \"True\"\n    type: PodScheduled\n  containerStatuses:\n  - image: kubernetesui\/dashboard:v2.7.0\n    imageID: \"\"\n    lastState: {}\n    name: kubernetes-dashboard\n    ready: false\n    restartCount: 0\n    started: false\n    state:\n      waiting:\n        message: 'Error response from daemon: Get \"https:\/\/registry-1.docker.io\/v2\/\":\n          net\/http: request canceled while waiting for connection (Client.Timeout\n          exceeded while awaiting headers)'\n        reason: ErrImagePull\n    volumeMounts:\n    - mountPath: \/certs\n      name: kubernetes-dashboard-certs\n    - mountPath: \/tmp\n      name: tmp-volume\n    - mountPath: \/var\/run\/secrets\/kubernetes.io\/serviceaccount\n      name: kube-api-access-7pk9w\n      readOnly: true\n      recursiveReadOnly: Disabled\n  hostIP: 192.168.65.3\n  hostIPs:\n  - ip: 192.168.65.3\n  phase: Pending\n  podIP: 10.1.1.124\n  podIPs:\n  - ip: 10.1.1.124\n  qosClass: BestEffort\n  startTime: \"2025-07-03T12:48:56Z\"<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\u6709 Error response from daemon: Get &#8220;https:\/\/registry-1.docker.io\/v2\/\uff0c \u770b\u6765\u8fd8\u662f\u8bbf\u95ee<a href=\"https:\/\/registry-1.docker.io\/v2\/\">https:\/\/registry-1.docker.io\/v2\/<\/a>\u955c\u50cf\u4ed3\u5e93\u6709\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u53ef\u4ee5\u770b\u5230docker\u672c\u5730\u662f\u6709\u8fd9\u4e2a\u955c\u50cf\u7684\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"509\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-1024x509.png\" alt=\"\" class=\"wp-image-18253\" style=\"width:568px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-1024x509.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-300x149.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-768x381.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-1536x763.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-2048x1017.png 2048w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-830x412.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-230x114.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-350x174.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/07\/image-15-480x238.png 480w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u4fee\u6539 Deployment \u4f7f\u7528\u672c\u5730\u955c\u50cf\uff1a\u4e34\u65f6\u4fee\u6539 Deployment\uff0c\u5f3a\u5236\u4f7f\u7528\u672c\u5730\u5df2\u5bfc\u5165\u7684\u955c\u50cf\uff08\u4e0d\u901a\u8fc7\u7f51\u7edc\u62c9\u53d6\uff09<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl edit deployment kubernetes-dashboard -n kubernetes-dashboard\n<\/pre>\n\n\n\n<p>\u5c06\u00a0<code><strong>imagePullPolicy<\/strong><\/code>\u00a0\u6539\u4e3a\u00a0<code><strong>IfNotPresent<\/strong><\/code>\uff08\u5982\u679c\u672c\u5730\u6709\u955c\u50cf\uff0c\u5219\u4e0d\u5c1d\u8bd5\u62c9\u53d6\uff09\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pec:\n  containers:\n  - name: kubernetes-dashboard\n    image: kubernetesui\/dashboard:v2.7.0\n    imagePullPolicy: IfNotPresent  # \u539f\u4e3a Always<\/pre>\n\n\n\n<p>\u6539\u5b8cDeployment\u4ee5\u540e\uff0cPod\u4f1a\u91cd\u65b0\u90e8\u7f72\uff0c\u53ef\u4ee5\u53d1\u73b0\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\u4e86\u3002<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u5b89\u88c5 Metrics API<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Metrics API<\/strong>\uff08\u7531&nbsp;<code>metrics-server<\/code>&nbsp;\u7ec4\u4ef6\u63d0\u4f9b\uff09\uff0c\u8be5\u7ec4\u4ef6\u7528\u4e8e\u6536\u96c6 Pod \u548c\u8282\u70b9\u7684\u8d44\u6e90\u4f7f\u7528\u6570\u636e\uff08CPU\u3001\u5185\u5b58\u7b49\uff09\u3002<\/p>\n\n\n\n<p>Metrics API \u662f Kubernetes \u4e2d\u7684\u6838\u5fc3\u76d1\u63a7\u7ec4\u4ef6\uff0c\u8d1f\u8d23<strong>\u6536\u96c6\u548c\u66b4\u9732\u96c6\u7fa4\u8d44\u6e90\u4f7f\u7528\u6570\u636e<\/strong>\uff08\u5982 CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8 I\/O \u7b49\uff09\u3002\u5b83\u4f5c\u4e3a\u6807\u51c6\u5316\u63a5\u53e3\uff0c\u4e3a\u4e0a\u5c42\u5de5\u5177\uff08\u5982&nbsp;<code>kubectl top<\/code>\u3001Horizontal Pod Autoscaler\u3001Prometheus\uff09\u63d0\u4f9b\u7edf\u4e00\u7684\u6307\u6807\u67e5\u8be2\u65b9\u5f0f\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u4ecb\u7ecd\uff1a<\/p>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<p><strong>1. \u6838\u5fc3\u6982\u5ff5\u4e0e\u67b6\u6784<\/strong><\/p>\n\n\n\n<p>Metrics API \u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a<\/p>\n\n\n\n<ol>\n<li>API \u670d\u52a1\uff08<code>metrics.k8s.io<\/code>\uff09\uff1a\n<ul>\n<li>\u5c5e\u4e8e Kubernetes API \u4f53\u7cfb\u7684\u4e00\u90e8\u5206\uff0c\u63d0\u4f9b\u6807\u51c6\u5316\u7684 REST API \u63a5\u53e3\u3002<\/li>\n\n\n\n<li>\u7248\u672c\uff1a<code>v1beta1<\/code>\uff08Kubernetes 1.8+\uff09\uff0c\u672a\u6765\u53ef\u80fd\u5347\u7ea7\u5230&nbsp;<code>v1<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u6570\u636e\u91c7\u96c6\u7ec4\u4ef6\uff08\u9ed8\u8ba4\u7531&nbsp;<code>metrics-server<\/code>&nbsp;\u5b9e\u73b0\uff09\uff1a\n<ul>\n<li>\u5468\u671f\u6027\u4ece\u8282\u70b9\u7684 kubelet \u6536\u96c6\u5bb9\u5668\u548c Pod \u7684\u8d44\u6e90\u4f7f\u7528\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u5c06\u6570\u636e\u805a\u5408\u540e\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\uff08\u4e0d\u652f\u6301\u5386\u53f2\u6570\u636e\u6301\u4e45\u5316\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<p><strong>2. \u6838\u5fc3\u4f5c\u7528<\/strong><\/p>\n\n\n\n<p>Metrics API \u662f Kubernetes \u76d1\u63a7\u4f53\u7cfb\u7684<strong>\u57fa\u7840\u7ec4\u4ef6<\/strong>\uff0c\u652f\u6491\u4ee5\u4e0b\u529f\u80fd\uff1a<\/p>\n\n\n\n<ul>\n<li>\u547d\u4ee4\u884c\u5de5\u5177\uff1a<br><code>kubectl top nodes\/pods<\/code>&nbsp;\u547d\u4ee4\u76f4\u63a5\u4ece Metrics API \u83b7\u53d6\u5b9e\u65f6\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u81ea\u52a8\u6269\u7f29\u5bb9\uff1a<br>Horizontal Pod Autoscaler\uff08HPA\uff09\u6839\u636e Metrics API \u7684\u6307\u6807\u81ea\u52a8\u8c03\u6574 Pod \u6570\u91cf\u3002<\/li>\n\n\n\n<li>\u8c03\u5ea6\u51b3\u7b56\uff1a<br>Kubernetes \u8c03\u5ea6\u5668\u6839\u636e\u8282\u70b9\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\uff08\u901a\u8fc7 Metrics API\uff09\u9009\u62e9\u6700\u4f18\u8282\u70b9\u3002<\/li>\n\n\n\n<li>\u53ef\u89c6\u5316\u5de5\u5177\uff1a<br>\u5982 Dashboard\u3001Grafana \u7b49\u53ef\u901a\u8fc7 Metrics API \u83b7\u53d6\u5b9e\u65f6\u76d1\u63a7\u6570\u636e\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<p><strong>3. \u5b89\u88c5\uff08\u9700\u8981\u7ffb\u5899\uff09\u2757\ufe0f\u2757\ufe0f<\/strong><\/p>\n\n\n\n<ul>\n<li>3.1 \u4e0b\u8f7d \u6700\u65b0\u7248\u672c metrics-server \u7684 components.yaml<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -O https:\/\/github.com\/kubernetes-sigs\/metrics-server\/releases\/latest\/download\/components.yaml<\/pre>\n\n\n\n<ul>\n<li>3.2 \u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u4fee\u6539\u914d\u7f6e\uff08\u89e3\u51b3\u8bc1\u4e66\u548c\u6027\u80fd\u95ee\u9898\uff09\nvi components.yaml\n\n# \u6dfb\u52a0\u4ee5\u4e0b\u53c2\u6570\uff08\u5728 spec.containers.args \u4e2d\uff09\uff1a\n- --kubelet-insecure-tls          # \u8df3\u8fc7 TLS \u9a8c\u8bc1\uff08\u6d4b\u8bd5\u73af\u5883\u4f7f\u7528\uff09\n- --metric-resolution=30s        # \u8bbe\u7f6e\u6307\u6807\u91c7\u96c6\u9891\u7387\uff08\u9ed8\u8ba4 15s\uff0c\u53ef\u8c03\u6574\uff09<\/pre>\n\n\n\n<p>\u2757\ufe0f\u2757\ufe0f \u56e0\u4e3a\u9700\u8981\u4eceregistry.k8s.io \u62c9\u53d6\u4e0b\u9762\u955c\u50cf\uff0c\u56fd\u5185\u7f51\u7edc\u53ef\u80fd\u65e0\u6cd5\u8bbf\u95ee\uff0c\u6240\u4ee5\u9700\u8981\u7ffb\u5899\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"547\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-1024x547.png\" alt=\"\" class=\"wp-image-17574\" style=\"width:466px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-1024x547.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-300x160.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-768x410.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-830x443.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-230x123.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-350x187.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63-480x256.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-63.png 1296w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u5e94\u7528\u914d\u7f6e\nkubectl apply -f components.yaml<\/pre>\n\n\n\n<ul>\n<li>3.3 \u9a8c\u8bc1metrics-server\u662f\u5426\u542f\u52a8<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u68c0\u67e5 metrics-server Pod \u72b6\u6001\nkubectl get pods -n kube-system -l k8s-app=metrics-server\n\n\u8f93\u51fa\u5982\u4e0b\uff1a\nNAME                              READY   STATUS    RESTARTS   AGE\nmetrics-server-8467fcc7b7-j7rl9   1\/1     Running   0          34m<\/pre>\n\n\n\n<ul>\n<li>3.4 \u9a8c\u8bc1Metrics API\u662f\u5426\u53ef\u7528<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u68c0\u67e5 Metrics API \u662f\u5426\u53ef\u7528\nkubectl get --raw \"\/apis\/metrics.k8s.io\/v1beta1\"\n\n\u8f93\u51fa\u5982\u4e0b\uff1a\n{\"kind\":\"APIResourceList\",\"apiVersion\":\"v1\",\"groupVersion\":\"metrics.k8s.io\/v1beta1\",\"resources\":[{\"name\":\"nodes\",\"singularName\":\"\",\"namespaced\":false,\"kind\":\"NodeMetrics\",\"verbs\":[\"get\",\"list\"]},{\"name\":\"pods\",\"singularName\":\"\",\"namespaced\":true,\"kind\":\"PodMetrics\",\"verbs\":[\"get\",\"list\"]}]}<\/pre>\n\n\n\n<ul>\n<li>3.5 \u7528kubectl\u547d\u4ee4 \u67e5\u8be2 Node\u96c6\u7fa4 \u548c Pod \u7684 \u5185\u5b58 CPU\u7b49\u6307\u6807<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u68c0\u67e5 Node \u6307\u6807\nkubectl top nodes\n\n\u8f93\u51fa\uff1a\nNAME             CPU(cores)   CPU(%)   MEMORY(bytes)   MEMORY(%)   \ndocker-desktop   187m         1%       5398Mi          69%   \n\n# \u68c0\u67e5 \u6240\u6709\u547d\u540d\u7a7a\u95f4\u7684 Pod\u6307\u6807\nkubectl top pods -A\n\n\u8f93\u51fa\uff1a\nNAMESPACE                NAME                                                    CPU(cores)   MEMORY(bytes)   \nkube-system              coredns-668d6bf9bc-7chdd                                3m           48Mi            \nkube-system              coredns-668d6bf9bc-tnx27                                3m           34Mi            \nkube-system              etcd-docker-desktop                                     20m          310Mi           \nkube-system              kube-apiserver-docker-desktop                           27m          323Mi           \nkube-system              kube-controller-manager-docker-desktop                  14m          138Mi           \nkube-system              kube-proxy-w8mq6                                        1m           78Mi            \nkube-system              kube-scheduler-docker-desktop                           10m          82Mi            \nkube-system              metrics-server-8467fcc7b7-j7rl9                         4m           24Mi            \nkube-system              storage-provisioner                                     2m           20Mi            \nkube-system              vpnkit-controller                                       0m           38Mi            \nkubernetes-dashboard     dashboard-metrics-scraper-5bd45c9dd6-q4wml              1m           40Mi            \nkubernetes-dashboard     kubernetes-dashboard-79cbcf9fb6-cp4px                   1m           68Mi            \nkubernetes-dashboard     kubernetes-dashboard-api-7b6b887946-76ncg               1m           51Mi            \nkubernetes-dashboard     kubernetes-dashboard-auth-769bf978b9-tnc8m              1m           36Mi            \nkubernetes-dashboard     kubernetes-dashboard-kong-79867c9c48-5sx4b              4m           161Mi           \nkubernetes-dashboard     kubernetes-dashboard-metrics-scraper-76df4956c4-k64r9   1m           36Mi            \nkubernetes-dashboard     kubernetes-dashboard-web-56df7655d9-rx7hh               1m           36Mi            \nwechat-applet-services   service-notification-deployment-7dc7db69d9-hbcn8        0m           79Mi            \nwechat-applet-services   service-task-executor-deployment-74c7dbd875-xn5t8       2m           132Mi           \nwechat-applet-services   service-thumbnail-deployment-77cfbbf8fd-9gq9v           0m           120Mi    <\/pre>\n\n\n\n<ul>\n<li>3.6 dashboard \u4e0a\u4e5f\u80fd\u770b\u5230\u96c6\u7fa4\u548cPod\u7684\u6307\u6807\u56fe\u5f62\u4e86<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-1024x494.png\" alt=\"\" class=\"wp-image-17591\" style=\"width:556px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-1024x494.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-300x145.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-768x371.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-1536x741.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-2048x989.png 2048w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-830x401.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-230x111.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-350x169.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/06\/image-73-480x232.png 480w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>k8s\u90e8\u7f72\u4e00\u4e2a\u7b80\u5355\u5b8c\u6574\u7684\u793a\u4f8b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6211\u4eec\u4f7f\u7528&nbsp;<strong><code>httpd<\/code>&nbsp;(Apache) \u955c\u50cf<\/strong>&nbsp;\u6765\u521b\u5efa\u4e00\u4e2a\u5b8c\u6574\u7684\u793a\u4f8b\uff0c\u5305\u62ec Deployment\u3001Service\uff0c\u5e76\u5c06\u670d\u52a1\u66b4\u9732\u5230\u96c6\u7fa4\u5916\u90e8\u3002<\/p>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<ul>\n<li>\u521b\u5efa\u793a\u4f8b\u7684namespace<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl create namespace k8s-study\n\u663e\u793a\uff1a\nnamespace\/k8s-study created<\/pre>\n\n\n\n<ul>\n<li>\u521b\u5efa Deployment<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># httpd-deployment.yaml\napiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: httpd-deployment\n  labels:\n    app: httpd\nspec:\n  replicas: 3  # \u521b\u5efa3\u4e2aPod\u526f\u672c\n  selector:\n    matchLabels:\n      app: httpd\n  template:\n    metadata:\n      labels:\n        app: httpd\n    spec:\n      containers:\n      - name: httpd\n        image: httpd:alpine  # \u4f7f\u7528docker hub \u5b98\u65b9httpd\u955c\u50cf\uff08Alpine\u8f7b\u91cf\u7248\uff09\n        ports:\n        - containerPort: 80  # Apache\u9ed8\u8ba4\u7aef\u53e3\n        resources:\n          limits:\n            memory: \"128Mi\"\n            cpu: \"100m\"<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u5e94\u7528 Deployment\uff1a\nkubectl apply -f httpd-deployment.yaml -n k8s-study\n\n\u663e\u793a\uff1a\ndeployment.apps\/httpd-deployment created<\/pre>\n\n\n\n<ul>\n<li>\u521b\u5efa Service<\/li>\n<\/ul>\n\n\n\n<p>\u521b\u5efa\u4e00\u4e2a NodePort \u7c7b\u578b\u7684 Service \u6765\u66b4\u9732 Apache \u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># httpd-service.yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: httpd-service\nspec:\n  selector:\n    app: httpd  # \u5339\u914dDeployment\u4e2d\u7684label\n  ports:\n    - protocol: TCP\n      port: 80        # Service\u7aef\u53e3\n      targetPort: 80  # Pod\u7aef\u53e3\n  type: NodePort      # \u66b4\u9732\u5230\u96c6\u7fa4\u5916\u90e8<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u5e94\u7528 Service\uff1a\nkubectl apply -f httpd-service.yaml -n k8s-study\n\n\u663e\u793a\uff1a\nservice\/httpd-service created<\/pre>\n\n\n\n<ul>\n<li>\u9a8c\u8bc1\u90e8\u7f72<\/li>\n<\/ul>\n\n\n\n<p>\u68c0\u67e5 Deployment \u548c Pod \u72b6\u6001\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get deployments -n k8s-study\n\nkubectl get pods -n k8s-study<\/pre>\n\n\n\n<ul>\n<li>\u68c0\u67e5 Service \u72b6\u6001\u5e76\u83b7\u53d6\u5206\u914d\u7684 NodePort<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl get services httpd-service -n k8s-study\n\n\u663e\u793a\uff1a\nNAME            TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE\nhttpd-service   NodePort   10.101.194.247   &lt;none>        80:32636\/TCP   2m37s\n\n\u8fd9\u91cc\u7684 32636 \u5c31\u662f\u968f\u673a\u5206\u914d\u7684 NodePort\uff08\u8303\u56f4 30000-32767\uff09\u3002<\/pre>\n\n\n\n<ul>\n<li>\u4ece\u96c6\u7fa4\u5916\u90e8\u8bbf\u95ee\u670d\u52a1<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl http:\/\/localhost:32636<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"224\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-1024x224.png\" alt=\"\" class=\"wp-image-17385\" style=\"width:632px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-1024x224.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-300x66.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-768x168.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-1536x335.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-830x181.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-230x50.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-350x76.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41-480x105.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-41.png 1694w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<ul>\n<li>\u901a\u8fc7dashboard\u4e5f\u80fd\u67e5\u770bpod\u72b6\u6001<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"348\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-1024x348.png\" alt=\"\" class=\"wp-image-17381\" style=\"width:610px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-1024x348.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-300x102.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-768x261.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-1536x522.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-2048x696.png 2048w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-830x282.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-230x78.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-350x119.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-38-480x163.png 480w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"311\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-1024x311.png\" alt=\"\" class=\"wp-image-17383\" style=\"width:628px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-1024x311.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-300x91.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-768x233.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-1536x466.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-2048x621.png 2048w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-830x252.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-230x70.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-350x106.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/05\/image-40-480x146.png 480w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u901a\u8fc7Docker\u684c\u9762\u5e94\u7528\u5728\u7535\u8111\u4e0a\u5b89\u88c5Kubernetes\u96c6\u7fa4\u53ef\u4ee5\u8bf4\u662f\u628a\u6211\u4eec\u5b66\u4e60K8s\u7684\u8d77\u6b65\u4f9d\u8d56\u964d\u5230\u4e86\u6700\u4f4e\uff0c\u8ba9\u6211\u4eec\u80fd\u5feb\u901f\u8df3\u8fc7\u5de5\u5177\u5b89\u88c5\u6b65\u9aa4\u5f00\u59cb\u6b63\u9898\u7684\u5b66\u4e60\uff0c\u60f3\u5b66K8s\u7684\u540c\u5b66\u4eec\u8d76\u7d27\u52a8\u624b\u8bd5\u8bd5\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\uff1ahttps:\/\/zhuanlan.zhihu.com\/p\/388874530 \u524d\u8a00 \u4e4b\u524d\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u8fc7\u51e0\u79cd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/17364"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17364"}],"version-history":[{"count":17,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/17364\/revisions"}],"predecessor-version":[{"id":18257,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/17364\/revisions\/18257"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}