Is there any way we can add or remove a probe for deployment

12/7/2016

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?

-- workhardcc
kubernetes
kubernetes-health-check

1 Answer

12/7/2016

You should be able to do

kubectl edit deployment <your deployment>

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

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

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>
-- Andreas Wederbrand
Source: StackOverflow