Complete the code to create a resource quota named mem-quota in the dev namespace.
kubectl create quota mem-quota --hard=[1] --namespace=devThe --hard flag sets the resource limits. Here, memory=1Gi limits memory usage to 1 GiB.
Complete the YAML snippet to define a resource quota limiting pods to 10 in the test namespace.
apiVersion: v1
kind: ResourceQuota
metadata:
name: pod-quota
namespace: test
spec:
hard:
pods: [1]The pods field under hard sets the maximum number of pods allowed. Here, it is set to 10.
Fix the error in this command to apply a resource quota YAML file named quota.yaml to the prod namespace.
kubectl apply -f [1] --namespace=prodThe file name must match exactly. The standard YAML file extension is .yaml.
Fill both blanks to create a resource quota YAML that limits CPU to 2 cores and memory to 4Gi in the staging namespace.
apiVersion: v1
kind: ResourceQuota
metadata:
name: cpu-mem-quota
namespace: staging
spec:
hard:
cpu: [1]
memory: [2]The CPU limit is set as a number (2 cores), and memory uses units like Gi. So CPU is 2 and memory is 4Gi.
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.
apiVersion: v1
kind: ResourceQuota
metadata:
name: qa-quota
namespace: qa
spec:
hard:
pods: [1]
cpu: [2]
memory: [3]The pods limit is 3, CPU is 1 core, and memory is 2Gi as per the question.