本文介绍了有什么办法可以添加或删除部署探针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

有时,人们在创建部署时没有活着/准备就绪"探针.我们该如何为该部署打补丁.我尝试使用PATCH +"Content-Type:application/strategic-merge-patch + json"无效.

Sometimes people create a deployment without liveniess/readiness probe. How can we patch a probe for that deployment.I try to use PATCH + "Content-Type:application/strategic-merge-patch+json" it doesn't work.

另一方面,如果我们使用探针创建了一个部署,我们如何将其删除?

On the other hand, if we created a deployment with probe how can we remove it?

推荐答案

您应该可以

kubectl edit deployment <your deployment>

,当前正在运行的部署中的yaml应该会在默认编辑器中弹出.

and the yaml from the currently running deployment should pop up in your default editor.

编辑它(添加/删除探针)并保存,kubectl将自动应用新文件.

Edit it (add/remove probe) and save and kubectl will apply the new file automatically.

当然,更好的方法是将部署yaml放在磁盘上,将其更改为包含探针并运行

Of course, a better way is to have the deployment yaml on disk, change it to contain the probe and run

kubectl apply -f <the yaml file>

这篇关于有什么办法可以添加或删除部署探针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 17:12