如何清理kubernetes中的replicaSet Desired、Current、Ready全部为0
时间: 2024-03-12 13:49:45 浏览: 22
如果 Kubernetes 中的 ReplicaSet 的 Desired、Current、Ready 值均为 0,则可以使用以下步骤进行清理:
1. 查找 Desired、Current、Ready 值均为 0 的 ReplicaSet 的名称:可以使用以下命令列出所有 ReplicaSet 并查找 Desired、Current、Ready 值均为 0 的 ReplicaSet 的名称:
```
kubectl get replicaset
```
找到 Desired、Current、Ready 值均为 0 的 ReplicaSet 的名称。
2. 删除 Desired、Current、Ready 值均为 0 的 ReplicaSet:使用以下命令删除 Desired、Current、Ready 值均为 0 的 ReplicaSet:
```
kubectl delete replicaset <ReplicaSet 名称>
```
这将删除指定的 Desired、Current、Ready 值均为 0 的 ReplicaSet,以及所有它所拥有的 Pod。
请注意,如果您只想删除 Desired、Current、Ready 值均为 0 的 ReplicaSet 而不删除其所拥有的 Pod,请使用以下命令:
```
kubectl delete replicaset <ReplicaSet 名称> --cascade=false
```
这将删除 Desired、Current、Ready 值均为 0 的 ReplicaSet,但保留其所拥有的 Pod。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)