1

Is there any way to perform an automatic rollback of a failed deployment? Any documentation?

I only see manual action in the documentation.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Pacolotero
  • 131
  • 4
  • Can you not just write a short script to check if the deployment failed and then run the rollback command? – jordanm Feb 24 '18 at 21:13

1 Answers1

1

Nothing that I know of. The challenge with doing this is twofold: knowing that a deployment has failed and then ensuring a rollback can be performed safely.

Failure detection means having reliable healthchecks and so forth, which you don't necessarily have by default.

Safe rollbacks may depend on making changes in dependent systems or backing resources, like rolling back database migrations, that k8s knows nothing about.

I think if you are in a good place with both of these things and are worrying about failed deployments then instead of automated rollbacks you should be looking at blue-green deployments instead, which are a much neater solution to this problem.