Challenge, Medium,  on  Kubernetes

Restrict Namespace Resources Using ResourceQuota

Scenario

A namespace team-a already exists in the cluster. The platform team wants to restrict resource consumption and the number of objects created in this namespace by configuring a ResourceQuota.


Task

  1. Create a ResourceQuota named team-a-quota in the namespace team-a with the following limits:
    ResourceLimit
    pods3
    requests.cpu1
    requests.memory128Mi
    limits.cpu2
    limits.memory1Gi
    configmaps5
    secrets3
  2. Create a Deployment named backend-app in the same namespace using the image nginx.
  3. Configure the Deployment with 2 replicas.
  4. Configure CPU and memory requests and limits to stay within the ResourceQuota and achieve Burstable QoS.
  5. Verify that all Pods are running successfully and assigned the Burstable QoS class.

Important Constraints

  • The total Pods created by the Deployment must not exceed the Pod quota (3).
  • The total CPU and memory requests/limits across both replicas must stay within the quota to achieve Burstable QoS.

Hint 1

A ResourceQuota enforces hard limits on the total resources and object counts in a namespace. When a ResourceQuota is present, every Pod must explicitly specify resource requests and limits. For Burstable QoS, set requests lower than limits. See the official docs: ResourceQuota


Test Cases