개요
– Private Repository (ECR)에 Airflow Helm Chart를 저장(Push)합니다.
– ECR에 업로드한 Helm Chart를 EKS Cluster에 설치합니다.
차트 동기화
Airflow Helm Chart 정보를 Private Repository인 ECR에 Push합니다.
EC2 접속
AWS CLI 사용이 가능한 EC2 인스턴스로 접속합니다.
모든 작업은 접속한 EC2 인스턴스에서 진행합니다.
SSH 접속
[ec2-user@ip-10-10-1-5 ~]$
ECR 생성
Helm Chart를 저장할 Private Repository를 생성합니다.
Private Repository 생성
aws ecr create-repository
--repository-name <Your Name>
--region ap-northeast-2
Your Name 대신 생성할 Repository 이름을 입력해주세요.
ECR 인증
Helm Chart를 저장할 ECR Registry에 Helm Client가 허가된 사용자임을 증명합니다.
인증 시도
aws ecr get-login-password
--region ap-northeast-2 | helm registry login
--username AWS
--password-stdin <Your AWS ACCOUNT ID>.dkr.ecr.ap-northeast-2.amazonaws.com
AWS Account ID는 12자리 숫자입니다.
Git 복제
Airflow 구성 요소를 Local로 다운로드 합니다.
Git Clone
git clone https://github.com/airflow-helm/charts.git
Helm CLI 확인
Helm 사용이 가능한지 확인합니다.
버전 확인
helm version --short
# Expected output
# v3.5.4+g1b5edb6
OCI 기능 활성화
Helm 3에서 OCI 사용이 가능하도록 변경합니다.
환경 변수 저장
export HELM_EXPERIMENTAL_OCI=1
차트 저장
다운로드 받은 Airflow 구성요소를 차트(Chart)로 저장합니다.
폴더 변경
차트 저장
# Move current directory
cd charts/charts/airflow
# Save charts
helm chart save . airflow
helm chart save . <Your AWS ACCOUNT ID>.dkr.ecr.ap-northeast-2.amazonaws.com/<Your Name>:airflow
차트 업로드
ECR Repository로 Helm Chart를 Push합니다.
차트 업로드(Push)
helm chart push <Your AWS ACCOUNT ID>.dkr.ecr.ap-northeast-2.amazonaws.com/<Your Name>:airflow
차트 확인
Helm Chart의 상세 정보를 조회합니다.
정보 조회
aws ecr describe-images
--repository-name <Your Name>
--region ap-northeast-2
# Expected Output
{
"imageDetails": [
{
"registryId": "51...",
"repositoryName": "laminar",
"imageDigest": "sha256:9190ed8b1dfc5e1b67c1d1c5e1c60be912004bee6b0e36b25b4ccd4374e4f8bc",
"imageTags": [
"airflow"
],
"imageSizeInBytes": 56295,
"imagePushedAt": "2021-08-09T04:03:23+00:00",
"imageManifestMediaType": "application/vnd.oci.image.manifest.v1+json",
"artifactMediaType": "application/vnd.cncf.helm.config.v1+json"
}
]
}
artifactMediaType의 값이 올바른 값인지 확인합니다.
차트 설치
OCI 기능 활성화 및 ECR 인증이 필요합니다.
앞서 소개한 OCI 기능 활성화 및 ECR 인증을 참고합니다.
차트 내려받기
ECR Private Repository에 저장한 Helm Chart를 Local로 내려 받습니다.
차트 내려받기
helm chart pull <Your AWS ACCOUNT ID>.dkr.ecr.ap-northeast-2.amazonaws.com/<Your Name>:airflow
차트 내보내기
접속한 EC2로 차트를
차트 내보내기(Export)
helm chart export <Your AWS ACCOUNT ID>.dkr.ecr.ap-northeast-2.amazonaws.com/<Your Name>:airflow --destination ./charts
차트 설치(Install)
차트 설치
cd charts
helm install airflow ./airflow
주의
Dependencies 설치 문제가 있어, 해당 자료는 참고만 하세요.
마지막으로,
끝까지 읽어주신 모든 분들께 감사드립니다.
다음 글 보기
이전 글 보기