Exam4Training

Does this command display all the pods in the cluster that are labeled as ‘env: development’?

Does this command display all the pods in the cluster that are labeled as ‘env: development’?

Solution: ‘kubectl get pods -I env=development’
A . Yes
B . No

Answer: B

Explanation:

The command ‘kubectl get pods -I env=development’ will not display all the pods in the cluster that are labeled as ‘env: development’. This is because the -I flag is not a valid option for kubectl get pods1. The correct flag to use is –selector or -l, which allows you to filter pods by labels2. Therefore, the correct command to display all the pods in the cluster that are labeled as ‘env: development’ is:

kubectl get pods –selector env=development

or

kubectl get pods -l env=development

Reference: kubectl Cheat Sheet | Kubernetes

Labels | Kube by Example

I hope this helps you understand the command and the label, and how they work with Kubernetes and pods. If you have any other questions related to Docker, please feel free to ask me.

Latest DCA Dumps Valid Version with 55 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version