안녕하세요 오늘은 BESPIN GLOBAL innovate AI실 송규호님이 ‘EKS에서 단일 애플리케이션을 n개의 POD으로 다중 배포하기(1)’ 무엇인지 소개해드리도록 하겠습니다.
AWS EKS 환경에서 단일 애플리케이션에 대하여 일부 환경변수만 변경하여 다중 배포하는 방법인데요.
변경이 필요한 부분은 각 애플리케이션 환경마다 AWS Parameter Store에 변수 등록을 한 후 Codebuild 환경변수에서 제어 하여 배포하는 방식입니다.
목차
- EKS 환경 구축
- 샘플 애플리케이션 생성 후 AWS Code Commit 연동
- 도커 이미지 만들고 ECR 설정
- CodeBuild 설정
- parameter store 설정, codebuild 환경변수 설정 후 애플리케이션 배포 실행
전체적인 순서는 위와 같습니다.
1. EKS 환경 구축 (생략)
2. 샘플 애플리케이션 생성 후 AWS Code Commit 연동
- 로컬에서 리액트 프로젝트 생성
경로 : /Users/gyuho.song/Desktop/gh/React
npx create-react-app hw-poc
- github(개인) hw_poc 레파지토리 생성
- github 연동
git remote add origin <https://github.com/kyuhosong/hw_poc.git>
git branch -M main
git push -u origin main
github에 소스 올라갔는지 확인
- AWS CodeCommit에 hw-poc repository 생성
- codecommit local 설치 경로 설정
경로 : /Users/gyuho.song/Desktop/gh/DE
- github에서 codecommit 이전
git clone <https://git-codecommit.us-east-1.amazonaws.com/v1/repos/hw_poc>
cd hw_poc
git remote add github <https://github.com/kyuhosong/hw_poc>
git remote -v
github<https://github.com/kyuhosong/hw_poc> (fetch)
github<https://github.com/kyuhosong/hw_poc> (push)
origin<https://git-codecommit.us-east-1.amazonaws.com/v1/repos/hw_poc> (fetch)
origin<https://git-codecommit.us-east-1.amazonaws.com/v1/repos/hw_poc> (push)
git fetch github
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 22 (delta 0), reused 22 (delta 0), pack-reused 0
Unpacking objects: 100% (22/22), 180.08 KiB | 4.50 MiB/s, done.
From <https://github.com/kyuhosong/hw_poc>
* [new branch] main -> github/main
git merge github/main --ff-only
git push origin main
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 11 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 180.10 KiB | 13.85 MiB/s, done.
Total 22 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Validating objects: 100%
To <https://git-codecommit.us-east-1.amazonaws.com/v1/repos/hw_poc>
* [new branch] main -> main
- code commit에서 소스 확인

여기까지 ‘EKS에서 단일 애플리케이션을 n개의 POD으로 다중 배포하기(1)’에 대해 소개해드렸습니다. 다음 포스팅에서 이어서 설명드리도록 하겠습니다. 유익한 정보가 되셨길 바랍니다. 감사합니다.
Written by 송 규호 / innovate AI실
BESPIN GLOBAL