0
0
Kubernetesdevops~15 mins

Deleting Pods in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Deleting Pods in Kubernetes
📖 Scenario: You are managing a Kubernetes cluster where some pods are running. Sometimes, you need to delete pods manually to free resources or restart them.
🎯 Goal: Learn how to list pods, select a pod name, and delete that pod using kubectl commands.
📋 What You'll Learn
Use kubectl commands to interact with pods
List pods in the default namespace
Delete a specific pod by name
💡 Why This Matters
🌍 Real World
Deleting pods is a common task when you want to restart applications or clean up resources in a Kubernetes cluster.
💼 Career
Knowing how to manage pods with kubectl is essential for DevOps engineers and system administrators working with Kubernetes.
Progress0 / 4 steps
1
List all pods in the default namespace
Run the command kubectl get pods to list all pods in the default namespace.
Kubernetes
Need a hint?

Use kubectl get pods to see all pods running.

2
Choose a pod name to delete
Assign the pod name my-app-pod-12345 to a variable called POD_NAME.
Kubernetes
Need a hint?

Use POD_NAME=my-app-pod-12345 to store the pod name.

3
Delete the pod using the variable
Run the command kubectl delete pod $POD_NAME to delete the pod stored in the variable POD_NAME.
Kubernetes
Need a hint?

Use kubectl delete pod $POD_NAME to delete the pod.

4
Confirm the pod is deleted
Run kubectl get pods again to confirm the pod my-app-pod-12345 is no longer listed.
Kubernetes
Need a hint?

Run kubectl get pods to check the pod list after deletion.