Argo Rollout 을 활용한 배포 전략 테스트 - https://devocean.sk.com/blog/techBoardDetail.do?ID=163189
개념
- Argo Rollouts는 Kubernetes 환경에서 롤링 업데이트를 관리하는 도구
- Argo Rollouts는 Progressive Delivery를 지원하는 도구
- Canary 배포시
- 일시적 홀딩 > Metric을 통해 new version에 대한 배포가 성공인지 아닌지 판단 > 추가 배포 진행
- Canary 배포시
2. 설치
MyDomain=myeks.net
CERT_ARN=`aws acm list-certificates --query 'CertificateSummaryList[].CertificateArn[]' --output text`
echo $CERT_ARN
cat <<EOT > argorollouts-values.yaml
dashboard:
enabled: true
ingress:
enabled: true
ingressClassName: alb
hosts:
- argorollouts.$MyDomain
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":80}, {"HTTPS":443}]'
alb.ingress.kubernetes.io/certificate-arn: $CERT_ARN
alb.ingress.kubernetes.io/ssl-redirect: '443'
EOT
kubectl create ns argo-rollouts
helm install argo-rollouts argo/argo-rollouts --version 2.35.1 -f argorollouts-values.yaml --namespace argo-rollouts
# 확인
kubectl get all -n argo-rollouts
kubectl get crd | grep argo
# rollouts cli
curl -LO <https://github.com/argoproj/argo-rollouts/releases/download/v1.6.4/kubectl-argo-rollouts-linux-amd64>
chmod +x ./kubectl-argo-rollouts-linux-amd64
mv ./kubectl-argo-rollouts-linux-amd64 /usr/local/bin/kubectl-argo-rollouts
# 설치 확인
kubectl argo rollouts version
Deploying a Rollout
# Run the following command to deploy the initial Rollout and Service:
kubectl apply -f <https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/basic/rollout.yaml>
kubectl apply -f <https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/basic/service.yaml>
kubectl argo rollouts get rollout rollouts-demo
https://argorollouts.<각자 자신의 도메인>/rollouts/default
kubectl argo rollouts set image rollouts-demo rollouts-demo=argoproj/rollouts-demo:yellow
# 아래 입력 혹은 UI에서 Promote Yes 클릭
kubectl argo rollouts promote rollouts-demo
#
kubectl argo rollouts get rollout rollouts-demo --watch
Aborting a Rollout
#
kubectl argo rollouts set image rollouts-demo rollouts-demo=argoproj/rollouts-demo:red
#
kubectl argo rollouts abort rollouts-demo
#
kubectl argo rollouts set image rollouts-demo rollouts-demo=argoproj/rollouts-demo:yellow
모든 자원 삭제
eksctl delete cluster --name $CLUSTER_NAME && aws cloudformation delete-stack --stack-name $CLUSTER_NAME