BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - 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
31 comments · newest first
AN
Antonio 7 hours ago
A) Yes, labels are key for filtering.
LO
Louis 5 days ago
B) No, it should be '-l' instead of '-I'.
JA
Jade 11 days ago
A) Yes, I checked the command.
OD
Odette 16 days ago
I think B) No, the syntax is wrong.
SH
Shannan 21 days ago
A) Yes, it shows all pods with that label.
NA
Naomi 26 days ago
Definitely B) No. The label flag is incorrect.
RO
Robt 1 month ago
I feel confused. The command looks off.
LE
Leatha 1 month ago
Right! So it's B) No for me.
DE
Delmy 1 month ago
But isn't the syntax wrong? It should be `-l` not `-I`.
RE
Renea 2 months ago
I agree, it should show them all.
TE
Tequila 2 months ago
I think it's A) Yes.
AL
Alexia 2 months ago
Yeah, definitely B) No.
BL
Blair 2 months ago
So, B) No then?
CY
Cyril 2 months ago
Good point! It should be 'kubectl get pods -l env=development'.
AL
Alexia 2 months ago
But the syntax looks off. Shouldn't it be '-l'?
BL
Blair 3 months ago
Agreed, it should show those pods.
CY
Cyril 3 months ago
I think it's A) Yes.
DY
Dyan 3 months ago
Definitely shows pods with that label!
DA
Daron 3 months ago
Seems right to me, but I’m not 100% sure.
KY
Kyoko 3 months ago
I thought `kubectl get pods` only shows all pods without filters?
HU
Hubert 3 months ago
Actually, it should be `-l` instead of `-I`.
CH
Chaya 4 months ago
Yes, that command is correct!
AL
Albina 4 months ago
Definitely not, it should be -l env=development.
LA
Laura 4 months ago
Wait, is that really how you filter by labels?
RO
Roosevelt 4 months ago
I thought it was -L for labels?
GA
Gail 4 months ago
Actually, it's -l for labels, not -I.
CR
Crista 4 months ago
Yes, that command is correct!
SH
Sheridan 5 months ago
I'm uncertain, but I feel like the command might still work in some contexts.
GE
Gerald 5 months ago
I practiced a similar question, and I believe the correct flag for filtering by labels is `-l`, not `-I`.
CH
Chauncey 5 months ago
I'm pretty sure it should display the pods, but I can't recall if the syntax is exactly right.
EL
Elvis 7 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