Which kubectl command displays all Pods in the current namespace?

  1. kubectl describe all pods
  2. kubectl get pods ✓
  3. kubectl list pods
  4. kubectl show pods

Correct answer: kubectl get pods

Option B is correct because 'kubectl get pods' is the standard, well-documented command for listing all Pods in the current namespace, returning their names, status, restart count, and age. Option A is incorrect because 'kubectl describe all pods' is not valid syntax; 'kubectl describe' requires a resource type and optionally a name (e.g., 'kubectl describe pod my-pod'), and 'all' is not a valid subresource modifier in that position. Option C is incorrect because 'kubectl list' is not a valid kubectl subcommand; the correct verb for retrieving resources is 'get'. Option D is incorrect for the same reason: 'kubectl show' does not exist as a kubectl command; 'get' and 'describe' are the appropriate commands for displaying resource information.

Topic: · kubectl, pods, kubernetes cli, ckad

Practice Certified Kubernetes App Developer (CKAD) Questions Free