The Goal: Zero-Downtime Deployments
Deploying software updates shouldn’t require scheduled maintenance windows or middle-of-the-night updates. Modern software architectures support continuous deployment strategies that update live systems without users noticing any disruption.
Blue-Green Deployments
In a Blue-Green deployment model, you maintain two identical production environments: “Blue” (the current active version) and “Green” (the new version).
- Deploy the new code to the Green environment and run comprehensive testing.
- When verified, route the traffic router/load balancer to point to Green.
- Keep Blue active as a standby. If an issue is detected, you can roll back instantly by pointing the router back to Blue.
Canary Deployments
A Canary deployment introduces the new version to a tiny subset of real users (e.g., 5%) before rolling it out to the rest of the infrastructure.
# Example traffic split in Kubernetes Ingress (Canary)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress-canary
annotations:
nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-weight: "10" # 10% of traffic
spec:
rules:
- host: app.anntechnologies.in