This page looks best with JavaScript enabled

Deleting pods in Kubernetes in Raspberry Pi CM4

 ·  ☕ 1 min read  ·  🐧 sysadmin
  1. Here is a video tutorial; continue reading for a list of written instructions.

Exercises to complete:

  1. Delete all pods from default namespace.
  2. Create a namespace
  3. Get namespaces
  4. Create a pod in a given namespace
  5. Display all pods
  6. Delete all pods from a given namespace
Delete all pods from default namespace.
1
2
3
4
# displays all pods in all namespaces
kubectl get pods -A
# The below command deletes pods in default namespace.
kubectl delete pods --all

Delete pods manually or create a namespace and delete pods from a defined namespace.

Create a namespace
1
kubectl create namespace my-pods
Get namespaces
1
kubectl get namespace
Create a pod in a given namespace
1
kubectl run ubuntu --image=ubuntu -n my-pods
Display all pods
1
kubectl get pods -A
Delete all pods from a given namespace
1
kubectl delete pods --all -n my-pods
Support the author with

sysadmin
WRITTEN BY
sysadmin
QA & Linux Specialist