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

Prepare for the Kubernetes Cloud Native Associate (KCNA) Certification test with engaging questions and detailed explanations. Perfect your knowledge and boost your confidence to pass the exam successfully!

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