nerdexam
Docker

DCA · Question #100

Does this command display all the pods in the cluster that are labeled as 'env: development'? Solution: 'kubectl get pods -I env=development'

The correct answer is A. Yes. The provided kubectl command uses the correct syntax to filter and display pods based on a specific label.

Submitted by mateo_ar· Apr 18, 2026Container Orchestration

Question

Does this command display all the pods in the cluster that are labeled as 'env: development'? Solution: 'kubectl get pods -I env=development'

Options

  • AYes
  • BNo

How the community answered

(36 responses)
  • A
    92% (33)
  • B
    8% (3)

Why each option

The provided `kubectl` command uses the correct syntax to filter and display pods based on a specific label.

AYesCorrect

The `kubectl get pods` command retrieves pod information. The `-l` (or `--selector`) flag is used to filter resources by labels, so `-l env=development` correctly selects and displays only the pods that have the label `env` with the value `development`.

BNo

The `-l` flag in `kubectl get pods` is the standard and correct way to filter pods by their associated labels.

Concept tested: Kubectl label selection

Source: https://kubernetes.io/docs/reference/kubectl/cheatsheet/#viewing-finding-resources

Topics

#kubectl#pods#labels#resource filtering

Community Discussion

No community discussion yet for this question.

Full DCA Practice