cpu memory resource

2020-03-02  本文已影响0人  cdz620

overview

资源限制参数

主要参数

其他细节:

cpu

spec.containers[].resources.requests.cpu

The spec.containers[].resources.limits.cpu

设置建议

没有,fuck,官网没有案例,文档解释不清。

--cpu-period

100000代表100ms内测量资源配额的情况

--cpu-cfs-quota

开启cpu资源限制,默认是开启状态

如果没有足够的资源可以调度

明明空间的resouce limit

apiVersion: v1
kind: LimitRange
metadata:
  name: mylimits
spec:
  limits:
  - max:
      cpu: "2"
      memory: 1Gi
    min:
      cpu: 200m
      memory: 6Mi
    type: Pod
  - default:
      cpu: 300m
      memory: 200Mi
    defaultRequest:
      cpu: 200m
      memory: 100Mi
    defaultLimit:
      cpu:500m
      memory:400m      
    max:
      cpu: "2"
      memory: 1Gi
    min:
      cpu: 100m
      memory: 3Mi

    type: Container

参数说明:

结果

$ kubectl describe limits mylimits --namespace=limit-example
Name:   mylimits
Namespace:  limit-example
Type        Resource      Min      Max      Default Request      Default Limit      Max Limit/Request Ratio
----        --------      ---      ---      ---------------      -------------      -----------------------
Pod         cpu           200m     2        -                    -                  -
Pod         memory        6Mi      1Gi      -                    -                  -
Container   cpu           100m     2        200m                 300m               -
Container   memory        3Mi      1Gi      100Mi                200Mi              -
上一篇 下一篇

猜你喜欢

热点阅读