Allocate or Limit resource for pods in Kubernetes?

后端 未结 2 767
一整个雨季
一整个雨季 2021-02-02 01:31

The resource limit of Pod has been set as:

resource
  limit
    cpu: 500m
    memory: 5Gi

and there\'s 10G mem left on the node.

2条回答
  •  佛祖请我去吃肉
    2021-02-02 02:05

    Kubernetes supports Quality of Service. If your Pods have limits set, they belong to the Guaranteed class and the likelihood of them getting killed due to system memory pressure is extremely low. If the docker daemon or some other daemon you run on the node consumes a lot of memory, that's when there is a possibility for Guaranteed Pods to get killed.

    The Kube scheduler does take into account memory capacity and memory allocated while scheduling. For instance, you cannot schedule more than two pods each requesting 5 GB on a 10GB node.

    Memory usage is not consumed by Kubernetes as of now for the purposes of scheduling.

提交回复
热议问题