zegl / kube-score

Kubernetes object analysis with recommendations for improved reliability and security. kube-score actively prevents downtime and bugs in your Kubernetes YAML and Charts. Static code analysis for Kubernetes.
https://kube-score.com
MIT License
2.75k stars 177 forks source link

Add check for update strategy #570

Closed joshiste closed 9 months ago

joshiste commented 9 months ago

There is no check on the update strategy.

To avoid interruptions during updates of deployments/statefulsets it's advisable to use a rolling update strategy. I think it is reasonable to add this check if the pods are targeted by a service to check for the update strategy.

KubeLinter has this check. Let me know what you think. If you find this acceptable, I'd happily contribute a PR.

zegl commented 9 months ago

Yes, this makes sense for Deployments. Add a warning if the strategy is "Recreate" and the Deployment is targeted by a Service.