0
0
Kubernetesdevops~30 mins

Resource quotas per namespace in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Resource quotas per namespace
📖 Scenario: You are managing a Kubernetes cluster for a small company. To keep resources fair and avoid one team using too much, you want to set limits on how much CPU and memory each team can use in their own namespace.
🎯 Goal: Create a Kubernetes resource quota for a namespace called team-a that limits CPU and memory usage. Then, check the quota status.
📋 What You'll Learn
Create a namespace called team-a
Create a resource quota named team-a-quota in the team-a namespace
Limit CPU requests to 2 cores and memory requests to 4Gi
Limit CPU limits to 4 cores and memory limits to 8Gi
Display the resource quota details for team-a namespace
💡 Why This Matters
🌍 Real World
Resource quotas help teams share a Kubernetes cluster fairly by limiting how much CPU and memory each namespace can use.
💼 Career
Setting and managing resource quotas is a common task for Kubernetes administrators and DevOps engineers to ensure cluster stability and fair resource distribution.
Progress0 / 4 steps
1
Create the team-a namespace
Write the kubectl command to create a namespace called team-a.
Kubernetes
Need a hint?

Use kubectl create namespace team-a to create the namespace.

2
Create the resource quota YAML file
Create a YAML file named team-a-quota.yaml with a resource quota named team-a-quota in the team-a namespace. It should limit CPU requests to 2 cores, memory requests to 4Gi, CPU limits to 4 cores, and memory limits to 8Gi.
Kubernetes
Need a hint?

Remember to set apiVersion: v1, kind: ResourceQuota, and specify hard limits under spec.

3
Apply the resource quota to the team-a namespace
Use the kubectl command to apply the team-a-quota.yaml file to the cluster.
Kubernetes
Need a hint?

Use kubectl apply -f team-a-quota.yaml to apply the quota.

4
Check the resource quota status
Write the kubectl command to show the resource quota details for the team-a namespace.
Kubernetes
Need a hint?

Use kubectl get resourcequota -n team-a to see the quota status.