kubernetes - kubectl 等到 pod 消失(终止)

我知道我可以使用 kubectl wait 来检查 pod 是否 Ready 但是有没有一种简单的方法来检查 pod 是否已经消失或正在 Terminating 状态?我正在运行一些测试,我只想在 pod(或与此相关的命名空间)完全消失时继续。

超时选项也会派上用场。

最佳答案

它实际上是等待命令的一部分。

kubectl wait --for=delete pod/busybox1 --timeout=60s

您可以使用 kubectl wait --help 查看此示例和更多内容。例如

--for='': The condition to wait on: [delete|condition=condition- name|jsonpath='{JSONPath expression}'=JSONPath Condition]. The default status value of condition-name is true, you > can set false with condition=condition-name=false.

https://stackoverflow.com/questions/71858436/

相关文章:

go - 用类型参数替换接口(interface)参数有什么好处?

haskell - 为什么类型为 [tail, init, reverse], [[a] -> [a

javascript - 解决对多个参数值的 promise

html - 一个 SVG 的多个路径的多个复选框

r - 将嵌套列表中的名称分配给它的子组件

typescript - 类型错误 : Cannot find module 'firebase-f

javascript - Vue 3 - "Failed to resolve component"

python - 正确完成所有操作后出现 Ngrok 错误 6022

c# - 无法启动程序,访问被拒绝 C# net6.0

javascript - Nuxt中如何使用动态图片?