如何在不删除部署的情况下删除处于 Pending 状态的 Kubernetes Pod?

发布于 2025-01-09 07:36:06 字数 827 浏览 0 评论 0原文

我运行

kubectl rollout restart deployment <my-deployment-name>

是为了重新启动在部署下启动的单个 Pod。

NAME                                   READY   STATUS    RESTARTS   AGE
<pod-name>-vf24n                       1/1     Running   1          7d
<pod-name>-8fgqt                       0/1     Pending   0          14m

遗憾的是,我的亲和节点上没有可用资源来执行此操作,因此新创建的 pod 停留在 Pending 状态。

Normal   NotTriggerScaleUp  2m57s (x31 over 7m58s)  cluster-autoscaler  pod didn't trigger scale-up (it wouldn't fit if a new node is added):
Warning  FailedScheduling   47s (x9 over 8m)        default-scheduler   0/3 nodes are available: 1 Insufficient memory, 2 node(s) didn't match Pod's node affinity/selector.

我想删除待处理的 Pod 或以某种方式恢复推出重新启动操作,而不删除部署。是否可以?

I ran

kubectl rollout restart deployment <my-deployment-name>

in order to restart my single pod, launched under the deployment.

NAME                                   READY   STATUS    RESTARTS   AGE
<pod-name>-vf24n                       1/1     Running   1          7d
<pod-name>-8fgqt                       0/1     Pending   0          14m

Sadly, I had no available resources on my affinity node to perform this operation, so the new created pod stuck in Pending state.

Normal   NotTriggerScaleUp  2m57s (x31 over 7m58s)  cluster-autoscaler  pod didn't trigger scale-up (it wouldn't fit if a new node is added):
Warning  FailedScheduling   47s (x9 over 8m)        default-scheduler   0/3 nodes are available: 1 Insufficient memory, 2 node(s) didn't match Pod's node affinity/selector.

I would like to delete the Pending pod or somehow revert the rollout restart operation, without deleting the deployment. Is it possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最丧也最甜 2025-01-16 07:36:06

kubectl rollout undo deployment/my-deployment-name 将撤消 rollout

kubectl rollout undo deployment/my-deployment-name will undo a rollout

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文