godaddy / kubernetes-client

Simplified Kubernetes API client for Node.js.
MIT License
961 stars 192 forks source link

How to do a deployment `rollout restart` #696

Closed younes-io closed 2 years ago

younes-io commented 3 years ago

I'd like to do a rollout restart using this library, but I can't find the relevant API :

kubectl rollout restart deployment/myApp

Could you please help?

P.S : I'd like to avoid the scaling to 0 and then to N.

linkdd commented 3 years ago

I've found this stackoverflow question.

TL;DR:

It seems that kubectl rollout restart just modifies an annotation within the pod template (which will cause a restart).

You can do the same with the patch() method of the client.