July 2019
Intermediate to advanced
502 pages
14h
English
Kubernetes lets you specify quotas per namespace. There are different types of quotas you can set, for example, CPU, memory, and counts of various objects, including persistent volume claims. Let's set some quotas for the default namespace of Delinkcious:
apiVersion: v1kind: Listitems:- apiVersion: v1 kind: ResourceQuota metadata: name: awesome-quota spec: hard: cpu: "1000" memory: 200Gi pods: "100"
Here is the command to apply to quota:
$ kubectl create -f resource-quota.yaml resourcequota/awesome-quota created
Now, we can check the resource quota objects for the actual usage and compare it to the quota to see how close we are:
$ kubectl get resourcequota awesome-quota -o yaml | grep status -A 8status: hard: cpu: ...