[root@region-master1 ~]# kubectl delete pod --all --grace-period=0 --force -n test2-ns2 Warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely. pod "harbor-operator-harbor-sample-harbor-database-0" force deleted pod "harbor-operator-harbor-sample-harbor-redis-0" force deleted pod "harbor-operator-harbor-sample-harbor-trivy-0" force deleted [root@region-master1 ~]# kubectl get pod -n test2-ns2 NAME READY STATUS RESTARTS AGE harbor-operator-harbor-sample-harbor-database-0 1/1 Running 0 7s harbor-operator-harbor-sample-harbor-redis-0 1/1 Running 0 7s harbor-operator-harbor-sample-harbor-trivy-0 0/1 Running 0 7s
时间: 2024-02-18 09:01:59 浏览: 356
您好,看到您的命令输出,`--grace-period=0 --force`参数将强制删除了`test2-ns2`命名空间中的所有pod。但是,您可以使用以下命令来确认pod是否已被删除:
```
kubectl get pod -n test2-ns2
```
如果输出为空,则表示该命名空间中已经没有任何pod了。但是,如果您看到pod的状态仍为Running,请耐心等待几秒钟,直到它们被完全删除。
相关问题
[root@region-master1 ~]# kubectl get rc -n test2-ns2 No resources found in test2-ns2 namespace. [root@region-master1 ~]# kubectl get rs -n test2-ns2 No resources found in test2-ns2 namespace. [root@region-master1 ~]# kubectl delete pod -n test2-ns2 --all pod "harbor-operator-harbor-sample-harbor-database-0" deleted pod "harbor-operator-harbor-sample-harbor-redis-0" deleted pod "harbor-operator-harbor-sample-harbor-trivy-0" deleted [root@region-master1 ~]# kubectl get deployments.apps -n test2 No resources found in test2 namespace. [root@region-master1 ~]# kubectl get deployments.apps -n test2-ns2 No resources found in test2-ns2 namespace. [root@region-master1 ~]# kubectl get deployments -n test2-ns2 No resources found in test2-ns2 namespace. [root@region-master1 ~]# kubectl get pod -n test2-ns2 NAME READY STATUS RESTARTS AGE harbor-operator-harbor-sample-harbor-database-0 1/1 Running 0 3m6s harbor-operator-harbor-sample-harbor-redis-0 1/1 Running 0 3m6s harbor-operator-harbor-sample-harbor-trivy-0 1/1 Running 0 2m36s
您好,看到您的命令输出,似乎您已经成功删除了`test2-ns2`命名空间中的所有pod。但是,您可以尝试使用以下命令来确认该命名空间中是否还有其他资源:
```
kubectl get all -n test2-ns2
```
该命令将显示该命名空间中的所有资源,包括pod、replication controllers、replica sets、deployments、services等等。如果输出为空,则表示该命名空间中已经没有任何资源了。
阅读全文