kubectl create secret docker-registry ecr-cred
--docker-server=${aws_account_id}.dkr.ecr.ap-northeast-2.amazonaws.com
--docker-username=AWS
--docker-password=$(aws ecr get-login-password --region ap-northeast-2)
--namespace=default
- 개발자가 수정된 앱 git push (APP REPOSITORY)
- Github Action (CI)
- Configure AWS credentials (Github Secret에 미리 등록 된 AWS KEY 사용)
- ECR Login
- Set Value : ECR_REGISTRY, ECR_REPOSITORY, IMAGE_TAG(cat VERSION file)
- docker image build & push
- Github Action (CD)
- CONFIG REPOSITORY git clone
- config repository의 helm - values.yaml 수정
- image tag를 수정하여 이미지 버전 업데이트
- 수정된 values.yaml 다시 push (GH_TOKEN Secret 등록 필요)
- ArgoCD에서 3분에 한번씩 config-repository Check하여 업데이트 수행
- Github Web hook을 통해 ArgoCD로 push 할 수도 있음
config-repo(Helm) : ‣
app-repo : https://github.com/DACHANCHOI/demo-app-gitaction-argocd
*config-repo(helm) 와 app-repo를 구분 하는 이유는 모든 서비스 app-repo에서 helm config를 가지고 있으면 repo 관리 차원에서 더 관리 어려워질 수 있음. config-repo를 표준화 하여 관리 하는 것이 더 좋음