github.com/koderover/helm@v2.17.0+incompatible/docs/chart_repository_sync_example.md (about) 1 # Syncing Your Chart Repository 2 *Note: This example is specifically for a Google Cloud Storage (GCS) bucket which serves a chart repository.* 3 4 ## Prerequisites 5 * Install the [gsutil](https://cloud.google.com/storage/docs/gsutil) tool. *We rely heavily on the gsutil rsync functionality* 6 * Be sure to have access to the Helm binary 7 * _Optional: We recommend you set [object versioning](https://cloud.google.com/storage/docs/gsutil/addlhelp/ObjectVersioningandConcurrencyControl#top_of_page) on your GCS bucket in case you accidentally delete something._ 8 9 ## Set up a local chart repository directory 10 Create a local directory like we did in [the chart repository guide](chart_repository.md), and place your packaged charts in that directory. 11 12 For example: 13 ```console 14 $ mkdir fantastic-charts 15 $ mv alpine-0.1.0.tgz fantastic-charts/ 16 ``` 17 18 ## Generate an updated index.yaml 19 Use Helm to generate an updated index.yaml file by passing in the directory path and the url of the remote repository to the `helm repo index` command like this: 20 21 ```console 22 $ helm repo index fantastic-charts/ --url https://fantastic-charts.storage.googleapis.com 23 ``` 24 This will generate an updated index.yaml file and place in the `fantastic-charts/` directory. 25 26 ## Sync your local and remote chart repositories 27 Upload the contents of the directory to your GCS bucket by running `scripts/sync-repo.sh` and pass in the local directory name and the GCS bucket name. 28 29 For example: 30 ```console 31 $ pwd 32 /Users/funuser/go/src/github.com/helm/helm 33 $ scripts/sync-repo.sh fantastic-charts/ fantastic-charts 34 Getting ready to sync your local directory (fantastic-charts/) to a remote repository at gs://fantastic-charts 35 Verifying Prerequisites.... 36 Thumbs up! Looks like you have gsutil. Let's continue. 37 Building synchronization state... 38 Starting synchronization 39 Would copy file://fantastic-charts/alpine-0.1.0.tgz to gs://fantastic-charts/alpine-0.1.0.tgz 40 Would copy file://fantastic-charts/index.yaml to gs://fantastic-charts/index.yaml 41 Are you sure you would like to continue with these changes? [y/N]} y 42 Building synchronization state... 43 Starting synchronization 44 Copying file://fantastic-charts/alpine-0.1.0.tgz [Content-Type=application/x-tar]... 45 Uploading gs://fantastic-charts/alpine-0.1.0.tgz: 740 B/740 B 46 Copying file://fantastic-charts/index.yaml [Content-Type=application/octet-stream]... 47 Uploading gs://fantastic-charts/index.yaml: 347 B/347 B 48 Congratulations your remote chart repository now matches the contents of fantastic-charts/ 49 ``` 50 ## Updating your chart repository 51 You'll want to keep a local copy of the contents of your chart repository or use `gsutil rsync` to copy the contents of your remote chart repository to a local directory. 52 53 For example: 54 ```console 55 $ gsutil rsync -d -n gs://bucket-name local-dir/ # the -n flag does a dry run 56 Building synchronization state... 57 Starting synchronization 58 Would copy gs://bucket-name/alpine-0.1.0.tgz to file://local-dir/alpine-0.1.0.tgz 59 Would copy gs://bucket-name/index.yaml to file://local-dir/index.yaml 60 61 $ gsutil rsync -d gs://bucket-name local-dir/ # performs the copy actions 62 Building synchronization state... 63 Starting synchronization 64 Copying gs://bucket-name/alpine-0.1.0.tgz... 65 Downloading file://local-dir/alpine-0.1.0.tgz: 740 B/740 B 66 Copying gs://bucket-name/index.yaml... 67 Downloading file://local-dir/index.yaml: 346 B/346 B 68 ``` 69 70 71 Helpful Links: 72 * Documentation on [gsutil rsync](https://cloud.google.com/storage/docs/gsutil/commands/rsync#description) 73 * [The Chart Repository Guide](chart_repository.md) 74 * Documentation on [object versioning and concurrency control](https://cloud.google.com/storage/docs/gsutil/addlhelp/ObjectVersioningandConcurrencyControl#overview) in Google Cloud Storage