Deployment strategies

Hi folks, an absolute beginner in ops tasks, working on my first deployment.

My question:
In github lets say i have a pipeline which builds and rollout(k8s) new changes on every pr merge, suppose one such change is not working as expected or buggy after the rollout(rollout is successful though), how to rollback to previous version or commit? or should I rollback both commit and the k8s deployment ? what is the best automated approach in this case?

I understand the kubectl rollout undo is meant for such cases but how does this sit in a production level cicd deployment pipeline? For example if I manually do rollout undo the app deployment would go back to previous version but the git current commit will still have the buggy code and so as of now I’m doing both revert the commit to previous commit and rollout undo the deployment manually.

I’m looking for the strategies how people generally does this?

HI @vishnumohan1996nov

There are multiple ways to achieve this. For example, if a rollback to the previous version is needed, then using git revert and pushing it to the remote would trigger a new release/deployment.

In other cases, one might fix the bug, test it, and release it as a new patch version of the application, which would then trigger a new release/deployment.

Additionally, GitOps simplifies such scenarios with automated rollback policies that trigger when health checks fail post-deployment.

It’s essential that the cluster’s state matches what’s declared in source control (Git).

Hope this helps.

Thanks for the reply, will read more about these topics :+1:

1 Like