4. You run kubectl delete pod my-pod but get the error: error: resource(s) not found. What is the most likely cause?
medium
A. The pod 'my-pod' does not exist in the current namespace.
B. The pod 'my-pod' is already deleted but still shows in the list.
C. You used the wrong command; delete cannot remove pods.
D. The cluster is down and cannot process commands.
Solution
Step 1: Analyze the error message
The error says resource not found, meaning the pod name is not found in the current namespace.
Step 2: Check common causes
Most often, this happens because the pod does not exist or you are in the wrong namespace.
Final Answer:
The pod 'my-pod' does not exist in the current namespace. -> Option A
Quick Check:
Resource not found = pod missing or wrong namespace [OK]
Hint: Check namespace and pod name if resource not found error [OK]
Common Mistakes:
Assuming delete cannot remove pods
Ignoring namespace context
Thinking cluster downtime causes this error
5. You want to delete all pods with the label app=frontend. Which command correctly deletes only those pods?
hard
A. kubectl delete -l app=frontend
B. kubectl delete pods --all
C. kubectl delete pods --selector app=frontend
D. kubectl delete pods app=frontend
Solution
Step 1: Understand label selector syntax
To delete pods by label, use the --selector or -l flag with the label key=value.
Step 2: Identify correct command
kubectl delete pods --selector app=frontend uses --selector app=frontend, which is the correct full flag. kubectl delete -l app=frontend uses -l but misses the resource type pods.
Step 3: Confirm other options
kubectl delete pods --all deletes all pods, not filtered. kubectl delete pods app=frontend is invalid syntax.
Final Answer:
kubectl delete pods --selector app=frontend -> Option C
Quick Check:
Use --selector or -l to filter pods by label [OK]
Hint: Use --selector or -l flag to delete by label [OK]
Common Mistakes:
Using --all deletes everything, not filtered
Incorrect syntax without --selector or -l
Confusing label with resource name
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.