0
0
Kubernetesdevops~10 mins

Resource quotas per namespace in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a resource quota named mem-quota in the dev namespace.

Kubernetes
kubectl create quota mem-quota --hard=[1] --namespace=dev
Drag options to blanks, or click blank then click option'
Amemory=1Gi
Bcpu=2
Cpods=5
Dstorage=10Gi
Attempts:
3 left
💡 Hint
Common Mistakes
Using CPU or pod limits instead of memory for this quota.
Omitting the namespace flag.
2fill in blank
medium

Complete the YAML snippet to define a resource quota limiting pods to 10 in the test namespace.

Kubernetes
apiVersion: v1
kind: ResourceQuota
metadata:
  name: pod-quota
  namespace: test
spec:
  hard:
    pods: [1]
Drag options to blanks, or click blank then click option'
A5
B10
C15
D20
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the value too low or too high.
Confusing pod count with CPU or memory limits.
3fill in blank
hard

Fix the error in this command to apply a resource quota YAML file named quota.yaml to the prod namespace.

Kubernetes
kubectl apply -f [1] --namespace=prod
Drag options to blanks, or click blank then click option'
Aquota.json
Bquota.yml
Cquota.yaml
Dquota.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong file extensions like .json or .txt.
Misspelling the file name.
4fill in blank
hard

Fill both blanks to create a resource quota YAML that limits CPU to 2 cores and memory to 4Gi in the staging namespace.

Kubernetes
apiVersion: v1
kind: ResourceQuota
metadata:
  name: cpu-mem-quota
  namespace: staging
spec:
  hard:
    cpu: [1]
    memory: [2]
Drag options to blanks, or click blank then click option'
A2
B4Gi
C1Gi
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using units for CPU like '2Gi'.
Setting memory without units.
5fill in blank
hard

Fill all three blanks to create a resource quota YAML that limits pods to 3, CPU to 1, and memory to 2Gi in the qa namespace.

Kubernetes
apiVersion: v1
kind: ResourceQuota
metadata:
  name: qa-quota
  namespace: qa
spec:
  hard:
    pods: [1]
    cpu: [2]
    memory: [3]
Drag options to blanks, or click blank then click option'
A3
B1
C2Gi
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of values.
Forgetting units for memory.