Kubernetes rolling deployments and database migrations : <p>When processing a rolling update with database migrations, how does kubernetes handle this? </p>

<p>For an instance - I have an app that gets updated from app-v1 to app-v2, which includes a migration step to alter an existing table. So this would mean it requires me to run something like <code>db:migrate</code> for a rails app once deployed.</p>

<p>When a rolling deployment takes place on 3 replica set. It will deploy from one pod to another. Potentially allowing PODs that don't have the new version of the app to break. </p>

<p>Although this scenario is not something that happens very often. It's quite possible that it would. I would like to learn about the best/recommended approaches for this scenario.</p>
