当前位置:  首页>> 技术小册>> Kubernets合辑9-资源约束

  1. apiVersion: v1
  2. kind: LimitRange
  3. metadata:
  4. name: limit-resource
  5. namespace: apps
  6. spec:
  7. limits:
  8. - default:
  9. memory: 1024Mi
  10. cpu: 500m
  11. defaultRequest:
  12. memory: 128Mi
  13. cpu: 100m
  14. max:
  15. memory: 2048Mi
  16. cpu: 1000m
  17. min:
  18. memory: 64Mi
  19. cpu: 50m
  20. type: Container
  1. [root@maxiaoke local-k8s-yaml]# kubectl describe ns apps
  2. Name: apps
  3. Labels: <none>
  4. Annotations: Status: Active
  5. No resource quota.
  6. Resource Limits
  7. Type Resource Min Max Default Request Default Limit Max Limit/Request Ratio
  8. ---- -------- --- --- --------------- ------------- -----------------------
  9. Container cpu 50m 1 100m 500m -
  10. Container memory 64Mi 2Gi 128Mi 1Gi -

该分类下的相关小册推荐: