AWS ECR에 helm chart(.tgz) 업로드하기 _ 404 Not Found 해결
ECR에 helm chart(.tgz) 파일을 push 하니
다음과 같은 "404 Not Found" 에러 발생하였다.
1) 디버깅
로그를 확인해보니 Helm이 OCI 이미지로 ECR에 push할 때
ECR 레포지토리 이름이 helm_frontend/frontend로 잘못 해석된 것임을 알 수 있었다.
현재 나의 설정은 다음과 같다.
- ECR 레포지토리 이름 : helm_frontend
- .tgz 이름: frontend-0.1.0.tgz
따라서 ECR로 push하기 위해서는 레포지토리 이름이 로그처럼
"helm_frontend/frontend" --> "helm_frontend"가 되어야 한다.
2) 해결 방법
이는 .tgz 이름과 ECR 레포지토리 이름을 일치시키면 바로 해결 가능하다.
나는 기존의 Chart.yaml을 수정하고 다시 패키징한 다음에 ECR 레포지토리에 push 하였다.
기존에는 name이 "frontend"로 되어 있어 package하면 "frontend-0.1.0.tgz"가 생성되었다.
따라서 push할 ECR 레포지토리 명과 동일하게 수정하여 다시 package하였다.
1. Chart.yaml 수정
2. helm package
3. ECR helm Registry 로그인 ( 빨간색 수정)
aws ecr get-login-password --region ap-northeast-2 | helm registry login --username AWS --password-stdin 000011112222.dkr.ecr.ap-northeast-2.amazonaws.com
4. helm push ( 빨간색 수정)
helm push helm_frontend-0.1.0.tgz oci://000011112222.dkr.ecr.ap-northeast-2.amazonaws.com
Helm Chart push 완료!