Limit and Quota Management
Contents
Per container
Documentation
Terminology
- memory/cpu request: amount of resources that a container is guaranted to obtain (but it can try using more). This information is used for pod scheduling on nodes
- memory/cpu limit: strong resource limit which triggers container destruction
apiVersion: apps/v1 kind: Deployment metadata: labels: run: stressmeout name: stressmeout spec: replicas: 1 selector: matchLabels: run: stressmeout template: metadata: labels: run: stressmeout spec: containers: - image: vish/stress name: stressmeout resources: limits: cpu: "1" memory: "1Gi" requests: cpu: "0.5" memory: "500Mi" args: - -cpus - "2" - -mem-total - "1950Mi" - -mem-alloc-size - "100Mi" - -mem-alloc-sleep - "1s"
Other
Per namespace quota.
- Compute Resource Quota We can limit the total sum of compute resources (CPU, memory, etc.) that can be requested in a given Namespace.
- Storage Resource Quota We can limit the total sum of storage resources (PersistentVolumeClaims, requests.storage, etc.) that can be requested.
- Object Count Quota We can restrict the number of objects of a given type (pods, ConfigMaps, PersistentVolumeClaims, ReplicationControllers, Services, Secrets, etc.).