Syncing Your Chart Repository

Note: This example is specifically for a Google Cloud Storage (GCS) bucketwhich serves a chart repository.

Prerequisites

  • Install the gsutil tool. Werely heavily on the gsutil rsync functionality
  • Be sure to have access to the Helm binary
  • Optional: We recommend you set objectversioningon your GCS bucket in case you accidentally delete something.

Set up a local chart repository directory

Create a local directory like we did in the chart repositoryguide, and place your packaged charts in that directory.

For example:

  1. $ mkdir fantastic-charts
  2. $ mv alpine-0.1.0.tgz fantastic-charts/

Generate an updated index.yaml

Use Helm to generate an updated index.yaml file by passing in the directory pathand the url of the remote repository to the helm repo index command like this:

  1. $ helm repo index fantastic-charts/ --url https://fantastic-charts.storage.googleapis.com

This will generate an updated index.yaml file and place in thefantastic-charts/ directory.

Sync your local and remote chart repositories

Upload the contents of the directory to your GCS bucket by runningscripts/sync-repo.sh and pass in the local directory name and the GCS bucketname.

For example:

  1. $ pwd
  2. /Users/me/code/go/src/helm.sh/helm
  3. $ scripts/sync-repo.sh fantastic-charts/ fantastic-charts
  4. Getting ready to sync your local directory (fantastic-charts/) to a remote repository at gs://fantastic-charts
  5. Verifying Prerequisites....
  6. Thumbs up! Looks like you have gsutil. Let's continue.
  7. Building synchronization state...
  8. Starting synchronization
  9. Would copy file://fantastic-charts/alpine-0.1.0.tgz to gs://fantastic-charts/alpine-0.1.0.tgz
  10. Would copy file://fantastic-charts/index.yaml to gs://fantastic-charts/index.yaml
  11. Are you sure you would like to continue with these changes?? [y/N]} y
  12. Building synchronization state...
  13. Starting synchronization
  14. Copying file://fantastic-charts/alpine-0.1.0.tgz [Content-Type=application/x-tar]...
  15. Uploading gs://fantastic-charts/alpine-0.1.0.tgz: 740 B/740 B
  16. Copying file://fantastic-charts/index.yaml [Content-Type=application/octet-stream]...
  17. Uploading gs://fantastic-charts/index.yaml: 347 B/347 B
  18. Congratulations your remote chart repository now matches the contents of fantastic-charts/

Updating your chart repository

You’ll want to keep a local copy of the contents of your chart repository or usegsutil rsync to copy the contents of your remote chart repository to a localdirectory.

For example:

  1. $ gsutil rsync -d -n gs://bucket-name local-dir/ # the -n flag does a dry run
  2. Building synchronization state...
  3. Starting synchronization
  4. Would copy gs://bucket-name/alpine-0.1.0.tgz to file://local-dir/alpine-0.1.0.tgz
  5. Would copy gs://bucket-name/index.yaml to file://local-dir/index.yaml
  6. $ gsutil rsync -d gs://bucket-name local-dir/ # performs the copy actions
  7. Building synchronization state...
  8. Starting synchronization
  9. Copying gs://bucket-name/alpine-0.1.0.tgz...
  10. Downloading file://local-dir/alpine-0.1.0.tgz: 740 B/740 B
  11. Copying gs://bucket-name/index.yaml...
  12. Downloading file://local-dir/index.yaml: 346 B/346 B

Helpful Links: Documentation on gsutilrsync The Chart Repository Guide* Documentation on object versioning and concurrencycontrolin Google Cloud Storage