Question 39
Kubernetes FundamentalsHow to view resources on all namespaces?
Correct answer: A
Explanation
`-A` means `--all-namespaces`, so `kubectl get all -A` lists resources across every namespace instead of only the current one. The `get all` form retrieves the standard resource types in the cluster, and adding `-A` expands the scope to all namespaces.
Why each option is right or wrong
A. kubectl get all -A
`kubectl get` accepts the namespace-scoping flag `-A`, which is the short form of `--all-namespaces`, so the command queries every namespace rather than the current context namespace. The `all` resource alias is a built-in kubectl shorthand for the standard workload and service objects, so `kubectl get all -A` is the correct cluster-wide listing command.
B. kubectl get all --global
C. kubectl get all namespaces
D. kubectl get all --all