차트 리포지토리 동기화
차트 리포지토리 동기화
로컬 및 원격 차트 리포지토리를 동기화하는 방법에 대한 가이드입니다.
출처: 문서
본문
참고: 이 예제는 특히 차트 리포지토리를 제공하는 Google Cloud Storage(GCS) 버킷을 위한 것입니다.
사전 요구 사항 (Prerequisites)
- gsutil 도구를 설치하세요. 우리는 gsutil rsync 기능을 크게 활용합니다.
- Helm 바이너리에 접근할 수 있는지 확인하세요.
- 선택 사항: 실수로 무언가를 삭제한 경우를 대비해 GCS 버킷에 객체 버전 관리(object versioning)를 설정하는 것을 권장합니다.
로컬 차트 리포지토리 디렉터리 설정
차트 리포지토리 가이드에서 했던 것처럼 로컬 디렉터리를 만들고, 패키징된 차트를 그 디렉터리에 배치하세요.
예를 들어:
$ mkdir fantastic-charts
$ mv alpine-0.1.0.tgz fantastic-charts/
업데이트된 index.yaml 생성
디렉터리 경로와 원격 리포지토리의 url을 helm repo index 명령에 전달해 업데이트된 index.yaml 파일을 생성합니다.
$ helm repo index fantastic-charts/ --url https://fantastic-charts.storage.googleapis.com
이렇게 하면 업데이트된 index.yaml 파일이 생성되어 fantastic-charts/ 디렉터리에 배치됩니다.
로컬 및 원격 차트 리포지토리 동기화
scripts/sync-repo.sh 를 실행하고 로컬 디렉터리 이름과 GCS 버킷 이름을 전달해 디렉터리 내용을 GCS 버킷에 업로드합니다.
예를 들어:
$ pwd
/Users/me/code/go/src/helm.sh/helm
$ scripts/sync-repo.sh fantastic-charts/ fantastic-charts
Getting ready to sync your local directory (fantastic-charts/) to a remote repository at gs://fantastic-charts
Verifying Prerequisites....
Thumbs up! Looks like you have gsutil. Let's continue.
Building synchronization state...
Starting synchronization
Would copy file://fantastic-charts/alpine-0.1.0.tgz to gs://fantastic-charts/alpine-0.1.0.tgz
Would copy file://fantastic-charts/index.yaml to gs://fantastic-charts/index.yaml
Are you sure you would like to continue with these changes?? [y/N]} y
Building synchronization state...
Starting synchronization
Copying file://fantastic-charts/alpine-0.1.0.tgz [Content-Type=application/x-tar]...
Uploading gs://fantastic-charts/alpine-0.1.0.tgz: 740 B/740 B
Copying file://fantastic-charts/index.yaml [Content-Type=application/octet-stream]...
Uploading gs://fantastic-charts/index.yaml: 347 B/347 B
Congratulations your remote chart repository now matches the contents of fantastic-charts/
차트 리포지토리 업데이트
차트 리포지토리 내용의 로컬 사본을 유지하거나 gsutil rsync 로 원격 차트 리포지토리 내용을 로컬 디렉터리에 복사해야 합니다.
예를 들어:
$ gsutil rsync -d -n gs://bucket-name local-dir/ # the -n flag does a dry run
Building synchronization state...
Starting synchronization
Would copy gs://bucket-name/alpine-0.1.0.tgz to file://local-dir/alpine-0.1.0.tgz
Would copy gs://bucket-name/index.yaml to file://local-dir/index.yaml
$ gsutil rsync -d gs://bucket-name local-dir/ # performs the copy actions
Building synchronization state...
Starting synchronization
Copying gs://bucket-name/alpine-0.1.0.tgz...
Downloading file://local-dir/alpine-0.1.0.tgz: 740 B/740 B
Copying gs://bucket-name/index.yaml...
Downloading file://local-dir/index.yaml: 346 B/346 B
유용한 링크:
- gsutil rsync 문서
- 차트 리포지토리 가이드
- Google Cloud Storage의 객체 버전 관리와 동시성 제어 문서
더 알아보기 (Learn more)
- 차트 리포지토리 가이드 - Helm 차트 리포지토리 만들기