如何恢复已删除的Pod?

huangapple go评论76阅读模式
英文:

How to revive a deleted pod?

问题

我使用命令 "kubectl delete pod --grace-period=0 --force --namespace" 强制删除了一个 pod,我期望该 pod 会重新生成,但它并没有,现在我甚至无法找到这个 pod 了。是否有一种方法可以重新生成一次已被删除的 Kubernetes pod,还是我需要用一个新的 pod 替换它?提前感谢!

英文:

I force deleted a pod using the command "kubectl delete pod --grace-period=0 --force --namespace " I expected the pod to regenerate itself but it has not and now I cannot even locate the pod anymore. Is there a way to regenerate a kubernetes pod that has once been deleted or do I need to replace it with a new pod? Thanks in advance!

答案1

得分: 2

  1. 如果该 Pod 不属于任何部署或副本集等资源,几乎不可能恢复该 Pod。
  2. 如果您手动部署过它,那么您一定有一个 spec.yaml 文件,其中您定义了资源规格,或者如果您通过命令行部署,您必须在终端中有相应的历史记录。
  3. 如果您通过流水线或自动化方式部署,您知道该去哪里查找 如何恢复已删除的Pod?
英文:
  1. If the pod is not under any deployment or replica set any such resources, it is almost impossible to retrieve the pod back.
  2. If you have deployed it manually, you must have had a spec.yaml file where you would have defined the resource spec or if you have deployed via command line, you must have the history in terminal.
  3. If you have deployed via pipeline or automation, you know where to search 如何恢复已删除的Pod?

答案2

得分: 0

  • It seems that the -a flag has been removed from kubectl pods get
  • This answer has some interesting options。
  • You can probably find it by name but cannot just "bring it back". It would need to be replaced.
英文:

It seems that the -a flag has been removed from kubectl pods get

This answer has some interesting options

You can probably find it by name but cannot just "bring it back". It would need to be replaced.

huangapple
  • 本文由 发表于 2023年6月6日 10:47:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76411146.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定