在Kubernetes中,ResourceQuota和LimitRange对象之间有什么区别

时间:2019-02-28 16:01:26

标签: kubernetes

请解释Kubernetes中ResourceQuota与LimitRange对象之间的区别

1 个答案:

答案 0 :(得分:2)

let g:netrw_liststyle = 3 LimitRange是Kubernetes集群管理员用来控制资源使用的对象。

ResourceQuota用于限制名称空间的总资源消耗,例如:

ResourceQuota

apiVersion: v1 kind: ResourceQuota metadata: name: object-counts spec: hard: configmaps: "10" persistentvolumeclaims: "4" replicationcontrollers: "20" secrets: "10" services: "10" 用于在项目内的容器和容器级别上管理约束。

LimitRange

请求超出这些apiVersion: "v1" kind: "LimitRange" metadata: name: "resource-limits" spec: limits: - type: "Pod" max: cpu: "2" memory: "1Gi" min: cpu: "200m" memory: "6Mi" - type: "Container" max: cpu: "2" memory: "1Gi" min: cpu: "100m" memory: "4Mi" default: cpu: "300m" memory: "200Mi" defaultRequest: cpu: "200m" memory: "100Mi" maxLimitRequestRatio: cpu: "10" 约束之外的资源的单个Pod或Container将被拒绝,而LimitRange仅适用于所有名称空间/项目的所有对象。