Namespace ¶
Scenario:
- Get namespace list
- Create new namespace
- Label a namespace
- Delete a namespace
Demo:
Get list of Namespace
Get list of Namespace with Label information.
Create a Namespace
Label the new created Namespace cka.
Create Nginx Deployment in Namespace cka.
Check Deployments and Pods running in namespace cka.
Result is below.
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nginx 1/1 1 1 2m14s
NAME READY STATUS RESTARTS AGE
pod/nginx-85b98978db-bmkhf 1/1 Running 0 2m14s
Delete namespace cka. All resources in the namespaces will be gone.
Tip:
- Kubernetes Namespaces stuck in Terminating status.