digitalocean / clusterlint

A best practices checker for Kubernetes clusters. 🤠
Apache License 2.0
542 stars 45 forks source link

Pods referencing DOBS volumes don't support Rolling deployments #107

Closed varshavaradarajan closed 3 years ago

varshavaradarajan commented 3 years ago

Add a check for pod deployment strategy for pods that reference DOBS volumes. This can be a blocker for worker node upgrades when draining a node

timoreimann commented 3 years ago

I recommend the check validates that the pods are managed by a StatefulSet, which is the only way to guarantee that the pods work as expected. (In particular, that two pods never run concurrently which can happen during evictions of Deployment-managed pods.)

We might have to relax the above constant somewhat when it comes to block access mode. That's something to check.

timoreimann commented 3 years ago

Whoops, saw #106 now only. If we have that issue, do we still need this one? Genuine question, I'm not sure myself.

varshavaradarajan commented 3 years ago

I don't know either. Statefulset can have a update strategy: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies, so, should we ensure that that is not set to RollingUpdate? I can make it just one check then.

timoreimann commented 3 years ago

@varshavaradarajan I could be misinterpreting the description, but to me it sounds like a StatefulSet RollingUpdate strategy should do the right thing as it's updating one pod at a time only. I also believe that the old OnDelete strategy should be okay too since StatefulSets handle deletes properly as mentioned elsewhere in the doc ("When Pods are being deleted, they are terminated in reverse order, from {N-1..0}.").