In kubectl, what does the -A flag do when listing resources?

Study for the Kubernetes Cloud Native Associate (KCNA) Certification 1 Test. Master the core concepts of Kubernetes with multiple-choice questions and detailed explanations. Prepare and boost your confidence for the KCNA certification exam!

Multiple Choice

In kubectl, what does the -A flag do when listing resources?

Explanation:
The flag expands the scope to include every namespace. It’s shorthand for --all-namespaces, so when you list resources with it, kubectl queries all namespaces in the cluster instead of just the current one. For example, kubectl get pods -A will show pods from every namespace. Keep in mind some resources aren’t namespaced (like nodes), so -A doesn’t change their scope in the same way, but for namespaced resources it clearly broadens the view to all namespaces.

The flag expands the scope to include every namespace. It’s shorthand for --all-namespaces, so when you list resources with it, kubectl queries all namespaces in the cluster instead of just the current one. For example, kubectl get pods -A will show pods from every namespace. Keep in mind some resources aren’t namespaced (like nodes), so -A doesn’t change their scope in the same way, but for namespaced resources it clearly broadens the view to all namespaces.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy