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

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: nginx-demo-1
  5. namespace: apps
  6. labels:
  7. app: nginx
  8. spec:
  9. containers:
  10. - name: nginx-demo-1
  11. image: linuxmaxiaoke/nginx:v1.0.0
  12. resources:
  13. limits:
  14. memory: 2048Mi
  15. cpu: 500m
  16. requests:
  17. memory: 512Mi
  18. cpu: 200m
  1. [root@maxiaoke local-k8s-yaml]# kubectl describe pod -n apps nginx-demo-1
  2. Limits:
  3. cpu: 500m
  4. memory: 2Gi
  5. Requests:
  6. cpu: 200m
  7. memory: 512Mi

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