Certified Kubernetes Administrator (CKA) Practice Test

Question: 1 / 400

How do you view all resources in a specific namespace?

By using kubectl get resources -n <namespace-name>

By using kubectl list all -n <namespace-name>

By using kubectl get all -n <namespace-name>

To view all resources in a specific namespace in Kubernetes, the correct command is to use "kubectl get all -n <namespace-name>". This command retrieves and displays details about various resource types within the specified namespace, including pods, services, deployments, and other objects.

The "get all" functionality is specifically designed to query all relevant resources in the specified context, allowing administrators and developers to quickly monitor or manage the resources in a given namespace without needing to list each type of resource individually.

The command format includes the "-n" flag, which specifies the namespace in which to look for the resources. This allows for a clear focus on a specific area of the cluster, rather than obtaining a wide view across all namespaces, which might produce overwhelming and less useful information.

Other options, while they might seem plausible, do not utilize the correct command for this task. For example, "kubectl list all" and "kubectl display all" do not exist as valid commands within the Kubernetes CLI, and "kubectl get resources" is also not a standard command to retrieve all resources. Thus, it is "kubectl get all -n <namespace-name>" that correctly fulfills the requirement of viewing all resources within a designated namespace.

Get further explanation with Examzify DeepDiveBeta

By using kubectl display all -n <namespace-name>

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy