Kubernetes/canary

ingress-nginx canary 설정

babbeolicoding 2026. 3. 2. 23:12
반응형

canary ⇒ 특정 pod에 설정한 weight만큼의 비율만 호출하게 하는 기능

 

ingress + deploy + svc 조합이 2개가 필요함

       [Ingress - Stable / Canary]
                     |
          ┌──────────┴──────────┐
          |                     |
         90%                   10%
          |                     |
   [test-service]     [test-canary-service]
          |                     |
    [Stable Pod1]          [Canary Pod1]
    
    
    
    
- Ingress
 : Stable/Canary용 Ingress가 각각 1개씩 존재
 : Host/Path는 동일할 수 있음

- Service
 : Stable: test-service → Stable Pods
 : Canary: test-canary-service → Canary Pods

- 트래픽 비율
 : Ingress의 **canary annotation weight**로 분배 (예: 90% Stable, 10% Canary)

 

 

ingress 설정 방법

nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-weight: "10"

 

 

 

반응형