- Here is a video tutorial; continue reading for a list of written instructions.
Exercises to complete:#
- Delete all pods from default namespace.
- Create a namespace
- Get namespaces
- Create a pod in a given namespace
- Display all pods
- 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
|
Comments