# 대규모 Zero-Downtime Blue-Green Deployments: 500개 이상의 Microservices 마이그레이션을 통해 배운 점

발행: (2025년 12월 12일 오전 05:45 GMT+9)
4 min read
원문: Dev.to

Source: Dev.to

프로덕션에 배포한 지 12개월 후 결과

지표개선
배포 실패율18 %0.7 %96 % 감소
평균 배포 시간42 min6 min86 % 빨라짐
P99 지연 스파이크+280 ms+11 ms
연간 사고 비용£1.8 M£34 k£1.766 M 절감
연간 절감액 (실패한 롤아웃 및 고스트 팟)~£340 k

롤링 업데이트가 더 이상 충분하지 않았던 이유

strategy:
  type: RollingUpdate
  rollingUpdate:
    maxSurge: 25%
    maxUnavailable: 0

문서상으로는 안전해 보였지만 실제로는:

  • 헬스 체크 지연으로 3–7초 동안 5xx 오류가 발생했습니다.
  • 하나의 불량 팟이 전체 롤아웃을 차단했습니다.
  • Pod Disruption Budget이 일관되게 무시되었습니다.
  • 롤백은 추가로 20–30분이 소요되었으며 종종 실패했습니다.

우리는 즉시, 원자적인 트래픽 전환이 필요했습니다.

배포된 2025 아키텍처

EKS 1.29 → Istio 1.20 → ArgoCD 2.11 → Helm 3.14 + Kustomize

└─ Two identical environments in the SAME cluster
     ├─ blue  ← currently LIVE (100 % traffic)
     └─ green ← new version lands here first

단일 Istio VirtualService가 공개 호스트명을 소유합니다.

마법: 세계를 전환하는 한 줄

# virtualservice-prod.yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: payment-api
spec:
  hosts:
  - payment.api.company.com
  http:
  - route:
    - destination:
        host: payment-api
        subset: live       # ← only this changes
      weight: 100

서브셋은 한 번만 정의됩니다:

subsets:
- name: blue
  labels:
    env: blue
- name: green
  labels:
    env: green
- name: live
  labels:
    env: blue   # initially points to blue

트래픽 전환 = 하나의 JSON 패치:

kubectl patch destinationrule payment-api --type=json \
  -p='[{"op":"replace","path":"/spec/subsets/2/labels/env","value":"green"}]'

완전 자동화 파이프라인 (GitHub Actions)

- name: Deploy to green
  run: helm upgrade payment-api ./chart --set env=green --install

- name: Smoke tests on green
  run: ./smoke.sh https://payment-api-green.internal

- name: Instant traffic switch
  if: success()
  run: flipper switch payment-api green --instant

- name: Wait 5 min then terminate old blue pods
  run: |
    sleep 300
    kubectl delete pod -l app=payment-api,env=blue --grace-period=30

우리가 마주친 함정 (및 해결 방법)

  • 데이터베이스 마이그레이션 – 먼저 그린에서 확장/축소 + Liquibase runOnChange.
  • Istio mTLS “peer not authenticated” – 초기 컨테이너에서 SDS 인증서를 사전 워밍업.
  • Prometheus가 오래된 메트릭을 스크래핑env != live를 제외하는 relabel_configs.
  • 짧은 타임아웃 스파이크 – 클라이언트 측 재시도 + 2 s 타임아웃.

복사‑붙여넣기 청사진

  1. Istio + Argo CD 설치.
  2. --set env=green 옵션으로 모든 Helm 릴리스를 복제합니다.
  3. DestinationRule에 blue / green / live 서브셋을 생성합니다.
  4. 초기에는 “live”를 blue에 연결합니다.
  5. 작은 flipper 스크립트를 작성합니다 (오픈소스 – 아래 GitHub 링크 참고).

최종 생각

2025년에 아직도 롤링 업데이트를 하고 있다면, 신뢰성, 비용, 그리고 수면에 숨은 비용을 지불하고 있는 것입니다.
Blue‑green + Istio + Argo CD는 이제 모든 진지한 플랫폼의 기본이 되었습니다.

행복하고 (페이저 없이) 배포하세요!

참고 자료

  • GitHub:
  • LinkedIn:
Back to Blog

관련 글

더 보기 »