nerdexam
Linux_Foundation

CKA · Question #34

List "nginx-dev" and "nginx-prod" pod and delete those pods

The task requires exiting the text editor and then using kubectl get pods to list and kubectl delete pod to remove the specified Kubernetes pods, 'nginx-dev' and 'nginx-prod'.

Submitted by lukas.cz· May 4, 2026Workloads and Scheduling

Question

List "nginx-dev" and "nginx-prod" pod and delete those pods

Exhibits

CKA question #34 exhibit 1
CKA question #34 exhibit 2

Explanation

The task requires exiting the text editor and then using kubectl get pods to list and kubectl delete pod to remove the specified Kubernetes pods, 'nginx-dev' and 'nginx-prod'.

Approach. The core task is to list and delete specific Kubernetes pods ('nginx-dev' and 'nginx-prod'). The current screen shows a text editor, not a command prompt. Therefore, the correct interaction involves a sequence of commands:

  1. Exit the text editor: First, the user must exit the currently open text editor to return to the command prompt. If using a vi-like editor, press Esc to ensure command mode, then type :q (to quit) or :q! (to quit without saving any accidental modifications, which is safer as this file is unrelated to the task). Press Enter.

  2. List the specified pods: Once at the command prompt, use the kubectl command to list the pods mentioned in the question: kubectl get pod nginx-dev nginx-prod. This command will display information about the 'nginx-dev' and 'nginx-prod' pods, confirming their existence and status.

    • Alternatively, kubectl get pods can be used to list all pods, and then visually identify 'nginx-dev' and 'nginx-prod'.
  3. Delete the specified pods: Finally, use the kubectl command to delete the pods: kubectl delete pod nginx-dev nginx-prod. This command will terminate and remove the 'nginx-dev' and 'nginx-prod' pods from the cluster.

Common mistakes.

  • common_mistake. A common mistake would be to interact with the disk.yaml file or the nginx-kusc00101 pod it defines. The question specifically asks for actions on 'nginx-dev' and 'nginx-prod', making the displayed YAML file a potential distraction. Attempts to create, modify, or delete the nginx-kusc00101 pod would be incorrect. Another mistake would be to try typing kubectl commands while still in the text editor, which would result in modifying the disk.yaml file instead of executing commands. Forgetting to exit the editor, or using incorrect kubectl syntax (e.g., kubectl delete pods instead of kubectl delete pod when specifying individual pod names) would also lead to failure.

Concept tested. This question tests fundamental Kubernetes pod management using the kubectl command-line interface. Specifically, it assesses the ability to list (kubectl get) and delete (kubectl delete) specific pods. It also implicitly tests basic proficiency in navigating a Linux terminal environment, including exiting a text editor like vi or vim.

Topics

#Pod management#kubectl commands#Resource deletion

Community Discussion

No community discussion yet for this question.

Full CKA Practice