Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.06 KB

kubernetes-resource-quota.md

File metadata and controls

46 lines (34 loc) · 1.06 KB

ResourceQuota

⬅️ Back to Kubernetes overview

Create a ResourceQuota with limits

kubectl create quota my-quota --hard=cpu=1,memory=1G

View the created ResourceQuota

kubectl describe quota my-quota

Now create a deployment with resource limits. You can use the file deployment.yaml to create the deployment.

kubectl apply -f kubernetes/quota/deployment.yaml

Now view the created ResourceQuota again

Now it's time to scale the deployment (So that we use more resources)

kubectl scale deploy webserver-quota --replicas 11

📝 With how many pods did you end up? How can you explain this?

Let's have a look at the replicaset

kubectl get rs -l app=webserver-quota
kubectl describe rs -l app=webserver-quota

📝 What is the exact reason that not all pods can be created?

Delete the resoruce that where created

kubectl delete deploy webserver-quota
kubectl delete quota my-quota

Exercise

  • Try to limit other types than cpu & memory resources