Docker Certified Associate (DCA) — Question 28
Does this command display all the pods in the cluster that are labeled as ‘env: development’?
‘kubectl get pods --all-namespaces -l ‘env in (development)’ ’
Answer options
- A. Yes
- B. No
Correct answer: B
Explanation
The command uses the label selector syntax 'env in (development)', which means it will match pods labeled with 'env: development' and any other environments listed. Therefore, if there are no pods labeled exactly as 'env: development', the output will be empty, making the correct answer 'No'.