Bird
0
0

What will be the output of the following command when run in a Kubernetes cluster with Istio installed?

medium📝 Command Output Q5 of 15
Kubernetes - Service Mesh
What will be the output of the following command when run in a Kubernetes cluster with Istio installed?
kubectl get svc -n istio-system -l app=prometheus
ALists Prometheus service details in the istio-system namespace
BShows all services in all namespaces
CReturns an error: label selector syntax incorrect
DNo services found because Prometheus is not installed by default
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command components

    The command lists services in the 'istio-system' namespace filtered by label 'app=prometheus'.
  2. Step 2: Interpret expected output

    If Prometheus is installed by Istio, the service with label 'app=prometheus' will be listed with details like cluster IP and ports.
  3. Final Answer:

    Lists Prometheus service details in the istio-system namespace -> Option A
  4. Quick Check:

    kubectl get svc with label selector lists matching services [OK]
Quick Trick: Label selectors filter resources by labels in kubectl [OK]
Common Mistakes:
  • Confusing namespace scope with all namespaces
  • Misunderstanding label selector syntax
  • Assuming Prometheus is not installed by default

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes