{"id":108717,"date":"2026-09-22T14:08:44","date_gmt":"2026-09-22T06:08:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/108717.html"},"modified":"2026-09-22T14:08:44","modified_gmt":"2026-09-22T06:08:44","slug":"k8s-%e8%bf%90%e7%bb%b4%e7%b3%bb%e5%88%97-%e7%ac%ac-9-%e5%a4%a9%ef%bc%9a%e8%b5%84%e6%ba%90%e7%ae%a1%e7%90%86-request-limit-%e4%b8%8e-hpa-%e5%bc%b9%e6%80%a7%e4%bc%b8%e7%bc%a9","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/108717.html","title":{"rendered":"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29"},"content":{"rendered":"<p>\u5728 Kubernetes \u7684\u4e16\u754c\u91cc&#xff0c;\u96c6\u7fa4\u8d44\u6e90\u6c38\u8fdc\u662f\u7a00\u7f3a\u7684\u3002CPU\u3001\u5185\u5b58\u3001\u5b58\u50a8&#xff0c;\u90fd\u662f\u6709\u9650\u7684\u7b97\u529b&#xff0c;\u800c\u96c6\u7fa4\u4e0a\u8fd0\u884c\u7740\u6210\u767e\u4e0a\u5343\u4e2a Pod\u3002\u5982\u679c\u6ca1\u6709\u4e00\u5957\u6e05\u6670\u7684\u8d44\u6e90\u7ba1\u7406\u673a\u5236&#xff0c;\u67d0\u4e2a\u5931\u63a7\u7684\u5e94\u7528\u53ef\u80fd\u77ac\u95f4\u5403\u6389\u6574\u53f0\u8282\u70b9\u7684\u5185\u5b58&#xff0c;\u628a\u5176\u4ed6\u65e0\u8f9c\u7684\u670d\u52a1\u4e00\u8d77\u62d6\u57ae\u3002\u4eca\u5929\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u5c31\u6765\u5f7b\u5e95\u641e\u61c2 K8s \u8d44\u6e90\u7ba1\u7406\u7684\u4e09\u5927\u6838\u5fc3&#xff1a;Request&#xff08;\u8d44\u6e90\u8bf7\u6c42&#xff09;\u3001Limit&#xff08;\u8d44\u6e90\u4e0a\u9650&#xff09;&#xff0c;\u4ee5\u53ca\u57fa\u4e8e\u8fd9\u4e24\u8005\u4e4b\u4e0a\u7684 HPA&#xff08;Horizontal Pod Autoscaler&#xff0c;\u6c34\u5e73 Pod \u81ea\u52a8\u4f38\u7f29&#xff09;\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260922060843-6ab21b6b0e4d5.jpg\" alt=\"K8s \u8fd0\u7ef4 \u7b2c9\u5929\" \/><\/p>\n<h3>\u6838\u5fc3\u6982\u5ff5&#xff1a;Request \u4e0e Limit \u7684\u533a\u522b<\/h3>\n<p>\u5728\u6df1\u5165\u4e4b\u524d&#xff0c;\u5fc5\u987b\u5148\u628a\u4e24\u4e2a\u5bb9\u6613\u6df7\u6dc6\u7684\u6982\u5ff5\u63b0\u5f00\u63c9\u788e\u3002\u5b83\u4eec\u662f\u8d44\u6e90\u7ba1\u7406\u7684\u57fa\u77f3&#xff0c;\u7406\u89e3\u504f\u5dee\u4f1a\u76f4\u63a5\u5bfc\u81f4\u751f\u4ea7\u4e8b\u6545\u3002<\/p>\n<h4>Request&#xff1a;\u8c03\u5ea6\u4e0e\u9884\u7559\u7684\u4f9d\u636e<\/h4>\n<p>Request \u8868\u793a\u5bb9\u5668\u300c\u671f\u671b\u83b7\u5f97\u300d\u7684\u8d44\u6e90\u91cf&#xff0c;\u4e5f\u5c31\u662f\u5bb9\u5668\u88ab\u8c03\u5ea6\u65f6&#xff0c;K8s \u8c03\u5ea6\u5668\u7528\u6765\u5224\u65ad\u300c\u8fd9\u4e2a Pod \u5e94\u8be5\u843d\u5728\u54ea\u53f0\u8282\u70b9\u4e0a\u300d\u7684\u5173\u952e\u4f9d\u636e\u3002\u8c03\u5ea6\u5668\u4f1a\u628a Pod \u4e2d\u6240\u6709\u5bb9\u5668\u7684 Request \u52a0\u8d77\u6765&#xff0c;\u5bfb\u627e\u4e00\u53f0\u5269\u4f59\u53ef\u7528\u8d44\u6e90\u8db3\u4ee5\u5bb9\u7eb3\u5b83\u7684\u8282\u70b9\u3002\u5982\u679c\u4e00\u4e2a Pod \u7684 Request \u603b\u91cf\u8d85\u8fc7\u4e86\u96c6\u7fa4\u91cc\u4efb\u4f55\u4e00\u53f0\u8282\u70b9\u7684\u53ef\u7528\u8d44\u6e90&#xff0c;\u8fd9\u4e2a Pod \u5c31\u4f1a\u4e00\u76f4\u5904\u4e8e Pending \u72b6\u6001&#xff0c;\u65e0\u6cd5\u88ab\u8c03\u5ea6\u3002<\/p>\n<p>\u9700\u8981\u7279\u522b\u6ce8\u610f\u7684\u662f&#xff1a;Request \u5e76\u4e0d\u662f\u4e00\u4e2a\u786c\u6027\u7684\u300c\u914d\u989d\u9501\u300d&#xff0c;\u800c\u662f\u4e00\u4e2a\u300c\u9884\u7559\u627f\u8bfa\u300d\u3002K8s \u4fdd\u8bc1\u5bb9\u5668\u81f3\u5c11\u80fd\u62ff\u5230 Request \u58f0\u660e\u7684\u8d44\u6e90&#xff0c;\u4f46\u5e76\u4e0d\u963b\u6b62\u5b83\u5728\u8282\u70b9\u7a7a\u95f2\u65f6\u4f7f\u7528\u66f4\u591a\u3002<\/p>\n<h4>Limit&#xff1a;\u5bb9\u5668\u8d44\u6e90\u7684\u5929\u82b1\u677f<\/h4>\n<p>Limit \u5219\u662f\u5bb9\u5668\u8d44\u6e90\u4f7f\u7528\u7684\u300c\u786c\u4e0a\u9650\u300d\u3002\u5bf9\u4e8e CPU&#xff0c;\u5f53\u5bb9\u5668\u5c1d\u8bd5\u4f7f\u7528\u8d85\u8fc7 Limit \u7684 CPU \u65f6&#xff0c;K8s \u4f1a\u901a\u8fc7 Cgroup \u673a\u5236\u5bf9 CPU \u8fdb\u884c\u9650\u6d41&#xff08;throttle&#xff09;&#xff0c;\u5bb9\u5668\u4e0d\u4f1a\u88ab\u6740\u6b7b&#xff0c;\u53ea\u662f\u88ab\u538b\u4f4f\u901f\u5ea6\u3002\u800c\u5bf9\u4e8e\u5185\u5b58\u5219\u5b8c\u5168\u4e0d\u540c&#xff1a;\u4e00\u65e6\u5bb9\u5668\u5185\u5b58\u4f7f\u7528\u8d85\u8fc7 Limit&#xff0c;K8s \u4f1a\u76f4\u63a5\u5224\u5b9a\u4e3a OOMKilled&#xff0c;\u6740\u6389\u5bb9\u5668\u5e76\u89e6\u53d1\u91cd\u542f\u3002<\/p>\n<p>\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u5185\u5b58\u7684 Request \u548c Limit \u901a\u5e38\u5efa\u8bae\u8bbe\u7f6e\u4e3a\u76f8\u7b49\u2014\u2014\u56e0\u4e3a\u5185\u5b58\u4e0d\u50cf CPU \u90a3\u6837\u53ef\u4ee5\u300c\u5e73\u6ed1\u9650\u6d41\u300d&#xff0c;\u8d85\u4e86\u5c31\u6b7b&#xff0c;\u4e0e\u5176\u7559\u4e00\u4e2a\u5371\u9669\u533a\u95f4&#xff0c;\u4e0d\u5982\u5e72\u8106\u9501\u6b7b\u3002<\/p>\n<h4>\u8d44\u6e90\u5355\u4f4d\u4e0e QoS \u7b49\u7ea7<\/h4>\n<p>CPU \u7684\u5355\u4f4d\u662f\u300c\u6838\u300d&#xff0c;\u53ef\u4ee5\u5199\u5c0f\u6570&#xff0c;\u4f8b\u5982 0.5 \u7b49\u4ef7\u4e8e 500m&#xff08;m \u4ee3\u8868\u6beb\u6838&#xff0c;1000m &#061; 1 \u6838&#xff09;\u3002\u5185\u5b58\u7684\u5355\u4f4d\u662f\u5b57\u8282&#xff0c;\u5e38\u7528 Mi&#xff08;\u5146&#xff09;\u548c Gi&#xff08;\u5409&#xff09;\u3002K8s \u4f1a\u6839\u636e Request \u4e0e Limit \u7684\u8bbe\u7f6e\u60c5\u51b5&#xff0c;\u81ea\u52a8\u628a Pod \u5212\u5206\u5230\u4e09\u79cd QoS&#xff08;\u670d\u52a1\u8d28\u91cf&#xff09;\u7b49\u7ea7\u4e4b\u4e00&#xff1a;Guaranteed\u3001Burstable\u3001BestEffort\u3002\u5f53\u8282\u70b9\u8d44\u6e90\u7d27\u5f20\u65f6&#xff0c;\u9a71\u9010&#xff08;Evict&#xff09;\u7684\u4f18\u5148\u7ea7\u987a\u5e8f\u5c31\u662f BestEffort &gt; Burstable &gt; Guaranteed&#xff0c;\u5373\u300c\u8d8a\u5b88\u89c4\u77e9\u8d8a\u5b89\u5168\u300d\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u6807\u51c6\u7684\u8d44\u6e90\u914d\u7f6e\u793a\u4f8b&#xff1a;<\/p>\n<p>apiVersion: v1<br \/>\nkind: Pod<br \/>\nmetadata:<br \/>\n  name: demo-app<br \/>\nspec:<br \/>\n  containers:<br \/>\n    &#8211; name: app<br \/>\n      image: nginx:1.24<br \/>\n      resources:<br \/>\n        requests:<br \/>\n          cpu: <span class=\"token string\">&#034;250m&#034;<\/span><br \/>\n          memory: <span class=\"token string\">&#034;256Mi&#034;<\/span><br \/>\n        limits:<br \/>\n          cpu: <span class=\"token string\">&#034;500m&#034;<\/span><br \/>\n          memory: <span class=\"token string\">&#034;512Mi&#034;<\/span><\/p>\n<h3>\u5b9e\u6218\u6b65\u9aa4&#xff1a;\u4ece\u8d44\u6e90\u914d\u7f6e\u5230 HPA \u4f38\u7f29<\/h3>\n<p>\u638c\u63e1\u4e86\u6982\u5ff5&#xff0c;\u63a5\u4e0b\u6765\u52a8\u624b\u3002\u6211\u4eec\u4f1a\u5206\u4e09\u6b65\u8d70&#xff1a;\u5148\u4e3a Deployment \u914d\u7f6e\u5408\u7406\u7684\u8d44\u6e90&#xff0c;\u518d\u90e8\u7f72 Metrics Server&#xff08;HPA \u7684\u6570\u636e\u6765\u6e90&#xff09;&#xff0c;\u6700\u540e\u521b\u5efa HPA \u5e76\u538b\u6d4b\u9a8c\u8bc1\u3002<\/p>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u7ed9\u5de5\u4f5c\u8d1f\u8f7d\u58f0\u660e\u8d44\u6e90<\/h4>\n<p>\u5148\u628a\u4e1a\u52a1\u5c01\u88c5\u6210\u4e00\u4e2a Deployment&#xff0c;\u5e76\u663e\u5f0f\u58f0\u660e resources \u5b57\u6bb5\u3002\u8fd9\u4e00\u6b65\u770b\u4f3c\u7b80\u5355&#xff0c;\u5374\u662f\u6574\u4e2a\u8d44\u6e90\u7ba1\u7406\u4f53\u7cfb\u7684\u5730\u57fa&#xff1a;<\/p>\n<p>apiVersion: apps\/v1<br \/>\nkind: Deployment<br \/>\nmetadata:<br \/>\n  name: web-app<br \/>\nspec:<br \/>\n  replicas: <span class=\"token number\">2<\/span><br \/>\n  selector:<br \/>\n    matchLabels:<br \/>\n      app: web-app<br \/>\n  template:<br \/>\n    metadata:<br \/>\n      labels:<br \/>\n        app: web-app<br \/>\n    spec:<br \/>\n      containers:<br \/>\n        &#8211; name: web<br \/>\n          image: nginx:1.24<br \/>\n          ports:<br \/>\n            &#8211; containerPort: <span class=\"token number\">80<\/span><br \/>\n          resources:<br \/>\n            requests:<br \/>\n              cpu: <span class=\"token string\">&#034;100m&#034;<\/span><br \/>\n              memory: <span class=\"token string\">&#034;128Mi&#034;<\/span><br \/>\n            limits:<br \/>\n              cpu: <span class=\"token string\">&#034;200m&#034;<\/span><br \/>\n              memory: <span class=\"token string\">&#034;256Mi&#034;<\/span><\/p>\n<p>\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u628a\u914d\u7f6e\u5e94\u7528\u5230\u96c6\u7fa4&#xff0c;\u5e76\u67e5\u770b Pod \u662f\u5426\u6b63\u5e38\u8c03\u5ea6&#xff1a;<\/p>\n<p>kubectl apply <span class=\"token parameter variable\">-f<\/span> web-app.yaml<br \/>\nkubectl get pods <span class=\"token parameter variable\">-l<\/span> <span class=\"token assign-left variable\">app<\/span><span class=\"token operator\">&#061;<\/span>web-app <span class=\"token parameter variable\">-o<\/span> wide<br \/>\nkubectl describe pod <span class=\"token parameter variable\">-l<\/span> <span class=\"token assign-left variable\">app<\/span><span class=\"token operator\">&#061;<\/span>web-app <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-A6<\/span> Requests<\/p>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u90e8\u7f72 Metrics Server \u63d0\u4f9b\u6307\u6807<\/h4>\n<p>HPA \u9700\u8981\u4ece Metrics API \u8bfb\u53d6 Pod \u7684\u5b9e\u65f6 CPU \u548c\u5185\u5b58\u4f7f\u7528\u7387\u3002\u9ed8\u8ba4\u96c6\u7fa4\u5f80\u5f80\u6ca1\u6709\u5b89\u88c5 Metrics Server&#xff0c;\u9700\u8981\u5148\u90e8\u7f72\u3002\u4ee5\u5b98\u65b9\u4ed3\u5e93\u4e3a\u4f8b&#xff1a;<\/p>\n<p>kubectl apply <span class=\"token parameter variable\">-f<\/span> https:\/\/github.com\/kubernetes-sigs\/metrics-server\/releases\/latest\/download\/components.yaml<br \/>\nkubectl get deployment metrics-server <span class=\"token parameter variable\">-n<\/span> kube-system<\/p>\n<p>\u90e8\u7f72\u5b8c\u6210\u540e&#xff0c;\u7a0d\u7b49\u7247\u523b&#xff0c;\u9a8c\u8bc1\u6307\u6807\u662f\u5426\u5df2\u7ecf\u91c7\u96c6\u4e0a\u6765&#xff1a;<\/p>\n<p>kubectl <span class=\"token function\">top<\/span> nodes<br \/>\nkubectl <span class=\"token function\">top<\/span> pods <span class=\"token parameter variable\">-l<\/span> <span class=\"token assign-left variable\">app<\/span><span class=\"token operator\">&#061;<\/span>web-app<\/p>\n<p>\u5982\u679c kubectl top \u80fd\u6b63\u5e38\u8f93\u51fa\u6570\u5b57&#xff0c;\u8bf4\u660e Metrics Server \u5de5\u4f5c\u6b63\u5e38&#xff0c;\u53ef\u4ee5\u8fdb\u5165\u4e0b\u4e00\u6b65\u4e86\u3002<\/p>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u521b\u5efa HPA \u5e76\u9a8c\u8bc1\u4f38\u7f29<\/h4>\n<p>HPA \u7684\u6838\u5fc3\u53c2\u6570\u662f\u76ee\u6807\u4f7f\u7528\u7387&#xff1a;\u5f53 Pod \u7684\u5e73\u5747 CPU \u4f7f\u7528\u7387\u8d85\u8fc7\u8bbe\u5b9a\u9608\u503c&#xff08;\u5982 50%&#xff09;\u65f6&#xff0c;HPA \u4f1a\u6269\u5145\u526f\u672c&#xff1b;\u4f4e\u4e8e\u9608\u503c\u5219\u7f29\u5bb9\u3002\u4e0b\u9762\u521b\u5efa\u4e00\u4e2a HPA&#xff0c;\u8ba9\u526f\u672c\u6570\u5728 2 \u5230 10 \u4e4b\u95f4\u5f39\u6027\u6d6e\u52a8&#xff1a;<\/p>\n<p>apiVersion: autoscaling\/v2<br \/>\nkind: HorizontalPodAutoscaler<br \/>\nmetadata:<br \/>\n  name: web-app-hpa<br \/>\nspec:<br \/>\n  scaleTargetRef:<br \/>\n    apiVersion: apps\/v1<br \/>\n    kind: Deployment<br \/>\n    name: web-app<br \/>\n  minReplicas: <span class=\"token number\">2<\/span><br \/>\n  maxReplicas: <span class=\"token number\">10<\/span><br \/>\n  metrics:<br \/>\n    &#8211; type: Resource<br \/>\n      resource:<br \/>\n        name: cpu<br \/>\n        target:<br \/>\n          type: Utilization<br \/>\n          averageUtilization: <span class=\"token number\">50<\/span><\/p>\n<p>\u5e94\u7528\u4e4b\u540e&#xff0c;\u67e5\u770b HPA \u72b6\u6001&#xff1a;<\/p>\n<p>kubectl apply <span class=\"token parameter variable\">-f<\/span> web-app-hpa.yaml<br \/>\nkubectl get hpa web-app-hpa<\/p>\n<p>\u8981\u9a8c\u8bc1\u5b83\u771f\u7684\u4f1a\u4f38\u7f29&#xff0c;\u53ef\u4ee5\u4e34\u65f6\u7528\u538b\u6d4b\u5de5\u5177\u7ed9\u670d\u52a1\u52a0\u538b\u3002\u8fd9\u91cc\u7528\u4e00\u4e2a\u7b80\u5355\u7684\u5faa\u73af\u8bf7\u6c42\u5236\u9020 CPU \u8d1f\u8f7d&#xff1a;<\/p>\n<p><span class=\"token keyword\">while<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">do<\/span> <span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> http:\/\/<span class=\"token operator\">&lt;<\/span>service-ip<span class=\"token operator\">&gt;<\/span>\/ <span class=\"token operator\">&gt;<\/span> \/dev\/null<span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">done<\/span><\/p>\n<p>\u51e0\u5206\u949f\u540e\u518d\u6b21\u67e5\u770b HPA \u72b6\u6001&#xff0c;\u4f60\u4f1a\u770b\u5230 TARGETS \u5217\u7684\u4f7f\u7528\u7387\u4e0a\u5347&#xff0c;REPLICAS \u9010\u6b65\u589e\u52a0&#xff1b;\u505c\u6b62\u538b\u6d4b\u540e&#xff0c;\u526f\u672c\u53c8\u4f1a\u6162\u6162\u964d\u56de\u6700\u5c0f\u503c\u3002<\/p>\n<h3>\u5e38\u89c1\u95ee\u9898\u4e0e\u907f\u5751\u6307\u5357<\/h3>\n<p>\u5728\u5b9e\u9645\u8fd0\u7ef4\u4e2d&#xff0c;\u8d44\u6e90\u7ba1\u7406\u548c HPA \u7684\u5751\u5927\u591a\u85cf\u5728\u7ec6\u8282\u91cc\u3002\u4e0b\u9762\u51e0\u4e2a\u662f\u6700\u9ad8\u9891\u7684\u3002<\/p>\n<p>\u95ee\u9898\u4e00&#xff1a;\u4e3a\u4ec0\u4e48\u8bbe\u7f6e\u4e86 HPA \u5374\u4e0d\u751f\u6548&#xff1f; \u7edd\u5927\u591a\u6570\u60c5\u51b5\u662f Metrics Server \u6ca1\u88c5\u597d&#xff0c;\u6216 kubectl top \u8bfb\u4e0d\u5230\u6570\u636e\u3002HPA \u5b8c\u5168\u4f9d\u8d56\u6307\u6807\u6765\u6e90&#xff0c;\u6ca1\u6709\u6307\u6807\u5c31\u6ca1\u6709\u4f38\u7f29\u3002\u5148\u7528 kubectl get apiservices | grep metrics \u786e\u8ba4 metrics API \u662f\u5426\u53ef\u7528\u3002<\/p>\n<p>\u95ee\u9898\u4e8c&#xff1a;CPU \u90fd\u6253\u6ee1\u4e86&#xff0c;Pod \u8fd8\u662f\u4e0d\u6269\u5bb9&#xff1f; \u68c0\u67e5 Deployment \u662f\u5426\u58f0\u660e\u4e86 resources.requests\u3002HPA \u8ba1\u7b97\u7684\u662f\u300c\u5b9e\u9645\u7528\u91cf \/ Request\u300d\u7684\u767e\u5206\u6bd4&#xff0c;\u6ca1\u6709 Request \u7684\u5bb9\u5668\u65e0\u6cd5\u8ba1\u7b97\u4f7f\u7528\u7387&#xff0c;HPA \u4f1a\u4e00\u76f4\u663e\u793a &lt;unknown&gt;\u3002<\/p>\n<p>\u95ee\u9898\u4e09&#xff1a;\u5185\u5b58\u80fd\u4e0d\u80fd\u7528 HPA \u4f38\u7f29&#xff1f; \u53ef\u4ee5&#xff0c;\u4f46\u5185\u5b58\u578b\u4f38\u7f29\u8981\u8c28\u614e\u3002CPU \u8d1f\u8f7d\u662f\u300c\u5f39\u6027\u300d\u7684&#xff0c;\u77ed\u65f6\u5c16\u5cf0\u53ef\u4ee5\u901a\u8fc7\u6269\u5bb9\u7f13\u89e3&#xff1b;\u800c\u5185\u5b58\u4e00\u65e6\u5403\u6ee1\u5f80\u5f80\u662f\u6cc4\u6f0f\u6216\u56fa\u5b9a\u5360\u7528&#xff0c;\u6269\u5bb9\u4e0d\u4e00\u5b9a\u80fd\u89e3\u51b3\u95ee\u9898&#xff0c;\u53cd\u800c\u5bb9\u6613\u5f15\u53d1\u9891\u7e41\u6296\u52a8\u3002<\/p>\n<p>\u95ee\u9898\u56db&#xff1a;Request \u8bbe\u592a\u5c0f\u4f1a\u600e\u6837&#xff1f; Request \u662f\u8c03\u5ea6\u4f9d\u636e&#xff0c;\u8bbe\u5f97\u592a\u5c0f\u4f1a\u5bfc\u81f4\u8282\u70b9\u8d85\u5356\u4e25\u91cd&#xff0c;\u591a\u4e2a Pod \u6324\u5728\u4e00\u53f0\u8282\u70b9\u4e0a&#xff0c;\u8d44\u6e90\u7ade\u4e89\u65f6\u4e92\u76f8\u62d6\u6162&#xff0c;QoS \u4e5f\u4f1a\u964d\u7ea7\u4e3a Burstable&#xff0c;\u8282\u70b9\u538b\u529b\u5927\u65f6\u5bb9\u6613\u88ab\u4f18\u5148\u9a71\u9010\u3002<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u8d44\u6e90\u7ba1\u7406\u662f Kubernetes \u8fd0\u7ef4\u7684\u300c\u5206\u6c34\u5cad\u300d&#xff1a;\u4e0d\u61c2\u5b83\u4e4b\u524d&#xff0c;\u96c6\u7fa4\u662f\u4e00\u4e2a\u968f\u65f6\u53ef\u80fd\u5d29\u6e83\u7684\u9ed1\u76d2&#xff1b;\u638c\u63e1\u4e86 Request\u3001Limit \u548c HPA \u4e4b\u540e&#xff0c;\u4f60\u5c31\u62e5\u6709\u4e86\u5bf9\u8d44\u6e90\u5206\u914d\u3001\u8c03\u5ea6\u3001\u4f38\u7f29\u7684\u5b8c\u6574\u638c\u63a7\u529b\u3002\u8bb0\u4f4f\u4e09\u6761\u6838\u5fc3\u539f\u5219&#xff1a;Request \u51b3\u5b9a Pod \u843d\u5728\u54ea\u91cc&#xff0c;Limit \u51b3\u5b9a\u5bb9\u5668\u80fd\u7528\u5230\u591a\u5c11&#xff0c;HPA \u51b3\u5b9a\u526f\u672c\u8be5\u6709\u51e0\u4e2a\u3002\u7ed9\u6240\u6709\u751f\u4ea7\u5de5\u4f5c\u8d1f\u8f7d\u663e\u5f0f\u58f0\u660e\u8d44\u6e90&#xff0c;\u662f\u6bcf\u4e00\u4e2a\u4e25\u8083\u8fd0\u7ef4\u56e2\u961f\u7684\u57fa\u672c\u529f\u3002<\/p>\n<p>\u4e0b\u671f\u9884\u544a&#xff1a;\u7b2c 10 \u5929\u6211\u4eec\u5c06\u8fdb\u5165 K8s \u6700\u590d\u6742\u7684\u90e8\u5206\u4e4b\u4e00\u2014\u2014\u7f51\u7edc\u6a21\u578b&#xff0c;\u6df1\u5165 CNI\u3001Calico \u4e0e NetworkPolicy&#xff0c;\u641e\u61c2 Pod \u4e4b\u95f4\u7684\u6d41\u91cf\u662f\u5982\u4f55\u6d41\u8f6c\u3001\u53c8\u5982\u4f55\u88ab\u5b89\u5168\u9694\u79bb\u7684\u3002\u656c\u8bf7\u671f\u5f85\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260922060843-6ab21b6b6de3e.png\" alt=\"\u5fae\u4fe1\u4e8c\u7ef4\u7801\" \/><\/p>\n<p>You must learn a new way to think before you can master a new way to be.<\/p>\n<p>\u5728\u638c\u63e1\u65b0\u65b9\u6cd5\u4e4b\u524d&#xff0c;\u4f60\u5fc5\u987b\u8981\u5148\u6362\u4e00\u79cd\u601d\u8003\u65b9\u6cd5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Kubernetes \u7684\u4e16\u754c\u91cc&#xff0c;\u96c6\u7fa4\u8d44\u6e90\u6c38\u8fdc\u662f\u7a00\u7f3a\u7684\u3002CPU\u3001\u5185\u5b58\u3001\u5b58\u50a8&#xff0c;\u90fd\u662f\u6709\u9650\u7684\u7b97\u529b&#xff0c;\u800c\u96c6\u7fa4\u4e0a\u8fd0\u884c\u7740\u6210\u767e\u4e0a\u5343\u4e2a Pod\u3002\u5982\u679c\u6ca1\u6709\u4e00\u5957\u6e05\u6670\u7684\u8d44\u6e90\u7ba1\u7406\u673a\u5236&#xff0c;\u67d0\u4e2a\u5931\u63a7\u7684\u5e94\u7528\u53ef\u80fd\u77ac\u95f4\u5403\u6389\u6574\u53f0\u8282\u70b9\u7684\u5185\u5b58&#xff0c;\u628a\u5176\u4ed6\u65e0\u8f9c\u7684\u670d\u52a1\u4e00\u8d77\u62d6\u57ae\u3002\u4eca\u5929\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u5c31\u6765\u5f7b\u5e95\u641e\u61c2 K8s \u8d44\u6e90\u7ba1\u7406\u7684\u4e09\u5927\u6838\u5fc3&#xff1a;Request&#xff08;\u8d44\u6e90\u8bf7\u6c42&#xff09;\u3001Limit&#xff08;\u8d44\u6e90\u4e0a\u9650&amp;#x<\/p>\n","protected":false},"author":2,"featured_media":108715,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11815,120,58],"topic":[],"class_list":["post-108717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-11815","tag-kubernetes","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29 - \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\/108717.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728 Kubernetes \u7684\u4e16\u754c\u91cc&#xff0c;\u96c6\u7fa4\u8d44\u6e90\u6c38\u8fdc\u662f\u7a00\u7f3a\u7684\u3002CPU\u3001\u5185\u5b58\u3001\u5b58\u50a8&#xff0c;\u90fd\u662f\u6709\u9650\u7684\u7b97\u529b&#xff0c;\u800c\u96c6\u7fa4\u4e0a\u8fd0\u884c\u7740\u6210\u767e\u4e0a\u5343\u4e2a Pod\u3002\u5982\u679c\u6ca1\u6709\u4e00\u5957\u6e05\u6670\u7684\u8d44\u6e90\u7ba1\u7406\u673a\u5236&#xff0c;\u67d0\u4e2a\u5931\u63a7\u7684\u5e94\u7528\u53ef\u80fd\u77ac\u95f4\u5403\u6389\u6574\u53f0\u8282\u70b9\u7684\u5185\u5b58&#xff0c;\u628a\u5176\u4ed6\u65e0\u8f9c\u7684\u670d\u52a1\u4e00\u8d77\u62d6\u57ae\u3002\u4eca\u5929\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u5c31\u6765\u5f7b\u5e95\u641e\u61c2 K8s \u8d44\u6e90\u7ba1\u7406\u7684\u4e09\u5927\u6838\u5fc3&#xff1a;Request&#xff08;\u8d44\u6e90\u8bf7\u6c42&#xff09;\u3001Limit&#xff08;\u8d44\u6e90\u4e0a\u9650&amp;#x\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/108717.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-22T06:08:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260922060843-6ab21b6b0e4d5.jpg\" \/>\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\/108717.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/108717.html\",\"name\":\"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-22T06:08:44+00:00\",\"dateModified\":\"2026-09-22T06:08:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/108717.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/108717.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/108717.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29\"}]},{\"@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":"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29 - \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\/108717.html","og_locale":"zh_CN","og_type":"article","og_title":"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728 Kubernetes \u7684\u4e16\u754c\u91cc&#xff0c;\u96c6\u7fa4\u8d44\u6e90\u6c38\u8fdc\u662f\u7a00\u7f3a\u7684\u3002CPU\u3001\u5185\u5b58\u3001\u5b58\u50a8&#xff0c;\u90fd\u662f\u6709\u9650\u7684\u7b97\u529b&#xff0c;\u800c\u96c6\u7fa4\u4e0a\u8fd0\u884c\u7740\u6210\u767e\u4e0a\u5343\u4e2a Pod\u3002\u5982\u679c\u6ca1\u6709\u4e00\u5957\u6e05\u6670\u7684\u8d44\u6e90\u7ba1\u7406\u673a\u5236&#xff0c;\u67d0\u4e2a\u5931\u63a7\u7684\u5e94\u7528\u53ef\u80fd\u77ac\u95f4\u5403\u6389\u6574\u53f0\u8282\u70b9\u7684\u5185\u5b58&#xff0c;\u628a\u5176\u4ed6\u65e0\u8f9c\u7684\u670d\u52a1\u4e00\u8d77\u62d6\u57ae\u3002\u4eca\u5929\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u5c31\u6765\u5f7b\u5e95\u641e\u61c2 K8s \u8d44\u6e90\u7ba1\u7406\u7684\u4e09\u5927\u6838\u5fc3&#xff1a;Request&#xff08;\u8d44\u6e90\u8bf7\u6c42&#xff09;\u3001Limit&#xff08;\u8d44\u6e90\u4e0a\u9650&amp;#x","og_url":"https:\/\/www.wsisp.com\/helps\/108717.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-22T06:08:44+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260922060843-6ab21b6b0e4d5.jpg"}],"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\/108717.html","url":"https:\/\/www.wsisp.com\/helps\/108717.html","name":"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-22T06:08:44+00:00","dateModified":"2026-09-22T06:08:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/108717.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/108717.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/108717.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"K8s \u8fd0\u7ef4\u7cfb\u5217 | \u7b2c 9 \u5929\uff1a\u8d44\u6e90\u7ba1\u7406\u2014\u2014Request\/Limit \u4e0e HPA \u5f39\u6027\u4f38\u7f29"}]},{"@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\/108717","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=108717"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/108717\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/108715"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=108717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=108717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=108717"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=108717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}