kubernetes namespace resources quota and limit
cpu limits:
apiVersion: v1
kind: LimitRange
metadata:
name: cpu-limit-range
namespace: sre
spec:
limits:
- default:
cpu: 1000m
defaultRequest:
cpu: 1000m
min:
cpu: 500m
max:
cpu: 2000m
maxLimitRequestRatio:
cpu: 4
type: Container
quota:
apiVersion: v1
kind: ResourceQuota
metadata:
name: quota
namespace: sre
spec:
hard: # 硬限制
pods: "1" # 限制此namespace里就不能超过1个pod
describe resource quota limit:
kubectl describe ns sre