Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Docker DCA Exam - Topic 2 Question 126 Discussion

Actual exam question for Docker's DCA exam
Question #: 126
Topic #: 2
[All DCA Questions]

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

Solution: 'kubectl get pods -I env=development'

Show Suggested Answer Hide Answer
Suggested Answer: B

The command 'kubectl get pods -I env=development' willnotdisplay all the pods in the cluster that are labeled as 'env: development'.This is because the -I flag isnota 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

:

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.


Contribute your Thoughts:

0/2000 characters

Currently there are no comments in this discussion, be the first to comment!


Save Cancel