Rolling back a Kubernetes deployment
Blog post from Octopus Deploy
Deployments to Kubernetes may not always go as planned, necessitating the use of rollback strategies to revert to a previous stable version. This article explores both general and Kubernetes-specific rollback techniques using Octopus Deploy, focusing on the deployment of a containerized Java-based PetClinic application. The proposed strategies include redeploying the previous version, conditionally executing steps during rollback, blocking release progression, and utilizing Kubernetes' built-in revision history for rollbacks. The process involves deploying MySQL and PetClinic containers, running Flyway jobs, and updating deployment annotations to tie releases to revisions. The article emphasizes the importance of calculating deployment mode to determine whether to execute certain steps and highlights the efficiency of rolling back using Kubernetes revision history, which can be completed in seconds aside from container startup time.