Bird
0
0

You want to create a ResourceQuota that limits pods to 10 and CPU to 4 cores but only for the 'dev' namespace. Which command correctly applies this?

hard📝 Workflow Q9 of 15
Kubernetes - Namespaces
You want to create a ResourceQuota that limits pods to 10 and CPU to 4 cores but only for the 'dev' namespace. Which command correctly applies this?
Akubectl set resourcequota quota1 --pods=10 --cpu=4 -n dev
Bkubectl create resourcequota quota1 --pods=10 --cpu=4 --namespace=dev
Ckubectl apply -f quota.yaml --namespace=default
Dkubectl apply -f quota.yaml -n dev
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to apply ResourceQuota YAML to a namespace

    Use 'kubectl apply -f' with '-n' or '--namespace' to specify the target namespace.
  2. Step 2: Evaluate options

    kubectl apply -f quota.yaml -n dev correctly applies quota.yaml to 'dev' namespace. Options A and B use invalid kubectl commands. kubectl apply -f quota.yaml --namespace=default applies to 'default' namespace, not 'dev'.
  3. Final Answer:

    kubectl apply -f quota.yaml -n dev -> Option D
  4. Quick Check:

    Apply YAML with -n for namespace = C [OK]
Quick Trick: Use 'kubectl apply -f file -n namespace' to apply quota [OK]
Common Mistakes:
  • Using invalid kubectl commands
  • Applying to wrong namespace
  • Confusing create and set commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes