TODO ! 限制容器使用的资源
Setting Quotas Within a Namespace
操作,在命名空间下创建配额:
# foo.yaml kind: ResourceQuota apiVersion: v1 metadata: name: podquota namespace: my-app spec hard: pods: "10"
kubectl create namespace my-app
kubectl create -f foo.yaml –namespace=my-app
kubectl describe resourcequota podquota –namespace=my-app
可以对一系列的对象进行配额限制,包括但不限于Pod、Secret、ConfigMap。
参考文献:「Configure Quotas for API Objects」
相关链接
Managing Compute Resources for Containers
Assign CPU Resources to Containers and Pods
Kubernetes 给容器和Pod分配内存资源