23장 GitHub production deploy에 승인과 rollout gate를 둔다
deploy job은 build가 성공해야 시작하고 GitHub environment: production의 reviewer·branch protection을 적용한다. 승인 화면에는 commit, image digest, 변경 요약, migration 여부, rollback image를 보여 주어야 한다. 의미 없는 “승인” 버튼은 통제 장치가 아니다.

aws eks update-kubeconfig --name flownote-lab --region "$AWS_REGION"
kubectl -n flownote set image deployment/flownote app="$IMAGE"
kubectl -n flownote rollout status deployment/flownote --timeout=5m
rollout status 성공은 새 replica가 Available이라는 뜻이지 business 기능 전체가 정상이라는 뜻은 아니다. 외부 smoke와 error rate를 추가한다.
curl --fail --retry 5 --retry-all-errors
"https://app.example.invalid/health/ready"
curl --fail "https://app.example.invalid/api/runtime" | jq -e
--arg sha "$GITHUB_SHA" '.commit == $sha'
실패하면 새 build부터 하지 않는다. 먼저 상태와 event를 보존하고 이전 image로 되돌린다.
kubectl -n flownote rollout history deployment/flownote
kubectl -n flownote rollout undo deployment/flownote
kubectl -n flownote rollout status deployment/flownote --timeout=5m
DB schema change가 이전 application과 호환되지 않으면 image rollback만으로 복구되지 않는다. expand→migrate→contract 순서로 backward-compatible migration을 설계한다.