9장 CI는 artifact를 만들고 GitOps는 환경을 바꾼다
CI가 kubectl apply로 cluster를 직접 변경하면 cloud credential과 환경 상태가 pipeline 안에 섞인다. GitOps에서는 CI가 test·scan·build·attest를 마치고 immutable image digest를 환경 repository에 제안한다. deployment controller가 Git의 desired state와 cluster를 reconcile한다.
application repo → CI → image digest + attestation
↓ pull request
environment repo → review → Argo CD → cluster
Argo CD automated sync는 Git과 live state 차이를 감지해 자동 동기화할 수 있다. 기본적으로 resource 삭제는 자동 prune되지 않는 안전 동작이므로, prune과 allowEmpty를 이해하지 않고 켜지 않는다. 이 책의 manifest는 prune: false, selfHeal: true로 시작한다.