小编Tom*_*ier的帖子

如何列出所有不是由控制器创建的 Pod

我需要获取不是由控制器创建的所有 Pod 的列表,以便我可以在节点上进行排空之前决定如何处理它们。

否则我会收到消息:

error: cannot delete Pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (use --force to override) while running the drain.
Run Code Online (Sandbox Code Playgroud)

我可以通过运行并查看 Controlled By: 是否丢失来找到信息kubectl describe <pod>,但我想以编程方式搜索节点上的所有 pod,因为它kubectl describe不是为此设计的。我需要找到替代方法。

kubernetes kubectl

4
推荐指数
1
解决办法
1330
查看次数

标签 统计

kubectl ×1

kubernetes ×1