Search

argo rollouts

0. argo rollouts를 왜 사용하는가?

1. 설치

Rollouts Controller 설치
# 네임스페이스 생성 kubectl create namespace argo-rollouts # 설치 kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
Bash
복사
설치 확인
kubectl get pods -n argo-rollouts
Bash
복사
→ argo-rollouts-xxxx 컨트롤러가 Running 상태여야 함.
플러그인 설치
# Argo Rollouts CLI 바이너리 최신 버전 다운로드 curl -LO https://github.com/argoproj/argo-rollouts/releases/latest/download/kubectl-argo-rollouts-linux-amd64 # 실행 권한 부여 chmod +x ./kubectl-argo-rollouts-linux-amd64 # 시스템 PATH에 있는 디렉토리로 이동 mv ./kubectl-argo-rollouts-linux-amd64 /usr/local/bin/kubectl-argo-rollouts # 설치 확인 kubectl argo rollouts version
Shell
복사
UI모드로 실행
# ec2의 새 세션에서 진행(맥에서만 가능) ssh -i mykey.pem -L 3100:localhost:3100 ubuntu@<EC2-PUBLIC-IP> # 대시보드 실행 kubectl argo rollouts dashboard
Shell
복사
→ 브라우저에서 http://localhost:3100/rollouts/ 로 접속
윈도우에서 ui모드로 실행(xshell 사용)

2. 적용 방법

1) Deployment → Rollout 교체

apiVersion: apps/v1 → apiVersion: argoproj.io/v1alpha1
kind: Deployment → kind: Rollout
spec.strategy에 Canary 또는 Blue-Green 전략 정의
strategy: canary: steps: - setWeight: 25 - pause: { duration: 10 } - setWeight: 50 - pause: { duration: 10 } - setWeight: 100
YAML
복사
enjoy-back-rollout.yaml
enjoy-front-rollout.yaml

2) Argo CD 연동 (GitOps)

Git에 Rollout YAML을 올려두면, 기존 Application 리소스로 그대로 동기화 가능
Argo CD UI에서는 리소스 트리 확인 가능, Canary 진행 상황은 Rollouts Dashboard에서 확인

3. 명령어 정리

1) 기본 확인

Rollout 목록 확인
kubectl get rollouts kubectl argo rollouts list
Bash
복사
특정 Rollout 상세 상태 보기
kubectl argo rollouts get rollout <rollout-name>
Bash
복사
→ 현재 단계, Pod 분포, Canary 진행률 확인 가능

2)배포 제어

새 버전으로 승격 (다음 단계로 진행)
kubectl argo rollouts promote <rollout-name>
Bash
복사
Canary 단계에서 대기 중일 때 강제로 다음 단계로 넘어감
롤백
kubectl argo rollouts undo <rollout-name>
Bash
복사
이전 안정 버전으로 되돌리기
Pause 상태로 두기
kubectl argo rollouts pause <rollout-name>
Bash
복사
Canary 단계 중 일시 정지 (문제 확인할 시간 확보)
Resume (일시 정지 해제)
kubectl argo rollouts resume <rollout-name>
Bash
복사

3) 실시간 모니터링

실시간 로그/상태 워치
kubectl argo rollouts get rollout <rollout-name> --watch
Bash
복사
배포 진행 상황을 계속 모니터링
대시보드 UI 실행
kubectl argo rollouts dashboard
Bash
복사
ec2에서 ssh -i mykey.pem -L 3100:localhost:3100 ubuntu@<EC2-PUBLIC-IP>로 접속 후 브라우저에서 http://localhost:3100/rollouts 접속

4) 히스토리 관리

히스토리 확인
kubectl argo rollouts history <rollout-name>
Bash
복사
이전 배포 버전 기록 확인
특정 리비전으로 롤백
kubectl argo rollouts undo <rollout-name> --to-revision=<n>
Bash
복사