Zero Downtime
Zero Downtime
Deployment/maintenance without service interruption. Blue-Green and Rolling strategies.
Zero Downtime
Deployment/maintenance without service interruption. Blue-Green and Rolling strategies.
Zero Downtime (zero-downtime deployment) is a technique for deploying a new version without interrupting the service. In traditional deployment methods, maintenance windows were announced and the service was taken down, but modern 24/7 services require 99.99% availability.
Representative strategies include Blue-Green (switching between two environments), Rolling (sequential replacement), and Canary (testing with a portion of traffic). Blue-Green runs two identical environments and switches instantly, Rolling replaces instances one at a time, and Canary validates first with 5-10% of traffic.
Technically, a load balancer distributes traffic, and health checks confirm that new instances are ready. Sessions are managed in external storage such as Redis, and Graceful Shutdown waits until in-flight requests are completed.
In practice, Kubernetes Deployment supports Rolling Update by default, and Blue-Green and Canary are implemented with ArgoCD or Spinnaker. When changing a database schema, the zero-downtime migration pattern (expand-contract) is applied.
# Kubernetes Rolling Update μ€μ
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 4
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # μΆκ° μμ± κ°λ₯ν Pod μ
maxUnavailable: 0 # νμ μ΅μ replicas μ μ§
template:
spec:
containers:
- name: app
image: myapp:v2
readinessProbe: # νΈλν½ λ°μ μ€λΉ νμΈ
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe: # 컨ν
μ΄λ μμ‘΄ νμΈ
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
lifecycle:
preStop: # Graceful Shutdown
exec:
command: ["sh", "-c", "sleep 10"]
---
# Blue-Green with Argo Rollouts
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: my-app-rollout
spec:
replicas: 4
strategy:
blueGreen:
activeService: my-app-active
previewService: my-app-preview
autoPromotionEnabled: false # μλ μΉμΈ νμ
Senior: "This deployment includes a DB schema change, so zero downtime may be difficult. Please share the migration plan."
Junior: "I plan to proceed in two steps: add the column and deploy the application, then remove nullable in the next release."
Interviewer: "What are the differences between Blue-Green and Canary deployments, and when do you use each?"
Candidate: "Blue-Green switches everything at once so it is fast, but it requires twice the resources. Canary validates gradually so the risk is lower, but it takes more time. I prefer Canary for validating new features and Blue-Green for infrastructure changes."
Take a mock interview on this topic β WIA SOOM AI Interview Β· Start for free
Reviewer: "The readinessProbe timeout is 5 seconds, so what happens if the app takes longer than that to start?"
Developer: "I'll increase initialDelaySeconds to 30 seconds and adjust it after measuring the actual boot time."