Deployment Strategies - FullstackCodingGuy/Developer-Fundamentals GitHub Wiki

image

Canary deployment

read ### Conditional release to subset of users (ex: based on % users or tenant etc)

Releases a new version to a small group of users before rolling it out to the rest. This approach allows for more granular control over the release process, and provides opportunities to test changes with real users. Canary deployment is ideal for testing new features and minimizing risks.

image
  • It is a progressive approach, allocating % of traffic to old and new pods.
  • When you dont want everything in one shot
  • Helpful for stateful applications
  • Handy when you want to test the applications first with a subset of users and then roll out for all users progressively.
  • Not handy for apps that require zero downtime for deployment as it involves effort for testing the new deployment.

Disavantage

  • Challenge in controlling traffic, how will you route the traffic for certain % of users

Blue-green deployment

read

Stateless and zero downtime

Maintains two identical environments, one active and one idle, and gradually shifts traffic from the active to the idle environment. This approach is ideal for minimizing downtime and enabling quick rollbacks. Blue-green deployment is best for major releases that significantly change the course of your software.

image

image
  • Useful for deploying stateless applications
  • For deploying applications without zero downtime

Disadvantage

  • More resources are needed for the switch, it needs a exact replica of what is currently running

Differences

  • When to use: Canary deployment is better for organizations with limited resources or those that prefer a more iterative approach to risk management. Blue-green deployment is better for organizations that prioritize speed and ease of deployment, and have sufficient resources to maintain two identical production environments.
  • Early Feedback: Canary deployment provides early feedback and the ability to identify bugs before the IT team rolls out the update to all users.
  • Rollback: Canary deployment allows for a quick and painless rollback if errors occur. Blue-green deployment also allows for quick rollbacks if issues arise.
  • Infra needs: Canary deployment doesn't require any spare hosting infrastructure. Blue-green deployment requires sufficient resources to maintain two identical production environments.

Argo Rollouts

read
  • assume current running stack as blue/live
  • create new deployment stack (replica set) as green/next
  • promote the green deployment to prod/live, rollout will bypass the traffic from blue to green, as make the green deployment stack as live, and the current stack becomes orange/prev for any rollback scenario
  • once the above step is done, the number of pods in blue stack will become 0 gracefully as the traffic routed to green (new blue)
image

Kubernetes Blue-Green deployments with Argo Rollouts

References

⚠️ **GitHub.com Fallback** ⚠️