Skip to Content
Hands-On Microservices with Kubernetes
book

Hands-On Microservices with Kubernetes

by Gigi Sayfan
July 2019
Intermediate to advanced
502 pages
14h
English
Packt Publishing
Content preview from Hands-On Microservices with Kubernetes

Specifying resource quotas

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: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes Microservices

Kubernetes Microservices

Richard Chesterwood
Cloud Native DevOps with Kubernetes

Cloud Native DevOps with Kubernetes

John Arundel, Justin Domingus
Microservices: Up and Running

Microservices: Up and Running

Ronnie Mitra, Irakli Nadareishvili

Publisher Resources

ISBN: 9781789805468Supplemental Content