Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubectl apply vs kubectl roll-update

If there an use case where kubectl apply should not be use to get a roll-update?

Despite the command original intent if we gave to kubectl apply a source file describing the resources of the cluster been updated over time, there any use case on which should not be use?

like image 978
bitgandtter Avatar asked Jan 28 '23 22:01

bitgandtter


1 Answers

The update strategy is specified in .spec.strategy in case of a Deployment and .spec.updateStrategy.type for DaemonSets and StatefulSets

For Deployments .spec.strategy.type can be “Recreate” or “RollingUpdate”. “RollingUpdate” is the default value.

For DaemonSets and StatefulSets, .spec.updateStrategy.type can be "OnDelete" or "RollingUpdate". "OnDelete" is the default value.

kubectl apply will respect these strategies, so I see no reason why not using it.

kubectl rolling-update is used only for ReplicationControllers which were replaced by Deployments

like image 196
Camil Avatar answered Feb 12 '23 18:02

Camil