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

Posted by Phyliss on May 16, 2026 at 02:13 AM

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

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

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.


Get Premium DCA Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
22 comments · newest first
RE
Renea 2 days ago
I agree, it should show them all.
TE
Tequila 7 days ago
I think it's A) Yes.
AL
Alexia 12 days ago
Yeah, definitely B) No.
BL
Blair 17 days ago
So, B) No then?
CY
Cyril 22 days ago
Good point! It should be 'kubectl get pods -l env=development'.
AL
Alexia 28 days ago
But the syntax looks off. Shouldn't it be '-l'?
BL
Blair 1 month ago
Agreed, it should show those pods.
CY
Cyril 1 month ago
I think it's A) Yes.
DY
Dyan 1 month ago
Definitely shows pods with that label!
DA
Daron 2 months ago
Seems right to me, but I’m not 100% sure.
KY
Kyoko 2 months ago
I thought `kubectl get pods` only shows all pods without filters?
HU
Hubert 2 months ago
Actually, it should be `-l` instead of `-I`.
CH
Chaya 2 months ago
Yes, that command is correct!
AL
Albina 2 months ago
Definitely not, it should be -l env=development.
LA
Laura 2 months ago
Wait, is that really how you filter by labels?
RO
Roosevelt 3 months ago
I thought it was -L for labels?
GA
Gail 3 months ago
Actually, it's -l for labels, not -I.
CR
Crista 3 months ago
Yes, that command is correct!
SH
Sheridan 3 months ago
I'm uncertain, but I feel like the command might still work in some contexts.
GE
Gerald 3 months ago
I practiced a similar question, and I believe the correct flag for filtering by labels is `-l`, not `-I`.
CH
Chauncey 4 months ago
I'm pretty sure it should display the pods, but I can't recall if the syntax is exactly right.
EL
Elvis 5 months ago
I think the command is close, but I remember something about using `-l` for labels instead of `-I`.
0/2000 characters

Save Cancel