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

Prepare for the KCNA Certification Test. Study with flashcards, multiple-choice questions, and detailed explanations to enhance your understanding of Kubernetes Cloud Native concepts. Ace your 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