Bird
0
0

You run kubectl get pods -n kube-system -l k8s-app=kube-dns. What output do you expect?

medium📝 Command Output Q4 of 15
Kubernetes - Networking
You run kubectl get pods -n kube-system -l k8s-app=kube-dns. What output do you expect?
AList of all pods in all namespaces
BNo pods found in kube-system namespace
CError: label selector not found
DList of CoreDNS pods running in kube-system namespace
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command and label selector

    The command lists pods in the kube-system namespace with label k8s-app=kube-dns, which selects CoreDNS pods.
  2. Step 2: Predict the output

    Since CoreDNS pods have this label, the command returns their list, showing running CoreDNS pods.
  3. Final Answer:

    List of CoreDNS pods running in kube-system namespace -> Option D
  4. Quick Check:

    Label selector lists CoreDNS pods = List of CoreDNS pods running in kube-system namespace [OK]
Quick Trick: Label selector filters CoreDNS pods in kube-system [OK]
Common Mistakes:
  • Expecting pods from all namespaces
  • Assuming label selector is invalid
  • Thinking no pods exist with that label

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes