- Create a compute quota object:
apiVersion: v1 kind: ResourceQuota metadata: name: compute-quota spec: hard: pods: "2" requests.cpu: "1" requests.memory: 20Mi limits.cpu: "2" limits.memory: 2Gi > kubectl create -f compute-quota.yaml resourcequota "compute-quota" created
- Next, let's add a count quota object:
apiVersion: v1 kind: ResourceQuota metadata: name: object-counts-quota spec: hard: configmaps: "10" persistentvolumeclaims: "4" replicationcontrollers: "20" secrets: "10" services: "10" services.loadbalancers: "2" > kubectl create -f object-count-quota.yaml resourcequota "object-counts-quota" created
- We can observe all the quotas:
> kubectl get quota NAME AGE compute-resources 17m object-counts 15m ...