ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 57 - DCA discussion

Report
Export

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

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

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.

asked 08/11/2024
Ricardo Andres
30 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first