How can I modify revisionHistoryLimit using commands?

931 views
Skip to first unread message

Manoj Khotele

unread,
Aug 23, 2016, 2:45:07 AM8/23/16
to Kubernetes user discussion and Q&A
Hello,

I want to deploy same image in different k8s-cluster; which are basically meant for different development environments.
But I want to use the same deployment yaml file.
I would like to achieve environment specific deviation by running additional commands.
So how can I modify revisionHistoryLimit using commands?


Best Regards,
Manoj

Daniel Smith

unread,
Aug 23, 2016, 1:20:27 PM8/23/16
to kubernet...@googlegroups.com
Haven't tried it, but a PATCH request like below should do the trick.

kubectl patch deployment dep-name -p '{"spec":{"revisionHistoryLimit":0}}'

But you should also consider substituting the correct value before you push at all, to eliminate a class of errors. Pushing a 0 and then changing it to something bigger is going to blow away all the history!

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages