|
| 1 | +--- |
| 2 | +title: Синхронізація вашого репозиторію чартів |
| 3 | +description: Описує, як синхронізувати ваші локальні та віддалені репозиторії чартів. |
| 4 | +sidebar_position: 2 |
| 5 | +--- |
| 6 | + |
| 7 | +:::note |
| 8 | +Цей приклад для хмарного сховища Google (Google Cloud Storage, GCS), кошик якого використовужться як репозиторій чартів. |
| 9 | +::: |
| 10 | + |
| 11 | +## Попередні умови {#prerequisites} |
| 12 | + |
| 13 | +* Встановіть [gsutil](https://cloud.google.com/storage/docs/gsutil). *Ми значною мірою покладаємося на використання gsutil rsync.* |
| 14 | +* Переконайтеся, що у вас є доступ до бінарного файлу Helm. |
| 15 | +* _Опціонально: Мирекомендуємо увімкнути [версіювання обʼєктів](https://cloud.google.com/storage/docs/gsutil/addlhelp/ObjectVersioningandConcurrencyControl#top_of_page) у вашому сховищі GCS, на випадок, якщо ви випадково щось видалите._ |
| 16 | + |
| 17 | +## Set up a local chart repository directory |
| 18 | + |
| 19 | +Створіть локальну теку, як ми це робили в [керівництві з репозиторію чартів](/topics/chart_repository.md), і помістіть ваші упаковані чарти в цю теку. |
| 20 | + |
| 21 | +Наприклад: |
| 22 | + |
| 23 | +```console |
| 24 | +$ mkdir fantastic-charts |
| 25 | +$ mv alpine-0.1.0.tgz fantastic-charts/ |
| 26 | +``` |
| 27 | + |
| 28 | +## Генерація оновленого файлу index.yaml {#generate-an-updated-index.yaml} |
| 29 | + |
| 30 | +Використовуйте Helm для генерації оновленого файлу index.yaml, передавши шлях до теки та URL-адресу віддаленого репозиторію команді `helm repo index`, як показано нижче: |
| 31 | + |
| 32 | +```console |
| 33 | +$ helm repo index fantastic-charts/ --url https://fantastic-charts.storage.googleapis.com |
| 34 | +``` |
| 35 | + |
| 36 | +Це згенерує оновлений файл index.yaml і помістить його в теку `fantastic-charts/`. |
| 37 | + |
| 38 | +## Синхронізація ваших локальних та віддалених репозиторіїв чартів {#sync-your-local-and-remote-chart-repositories} |
| 39 | + |
| 40 | +Завантажте вміст теки у ваше сховище GCS, запустивши `scripts/sync-repo.sh` та передавши назву локальної теки та назву сховища GCS. |
| 41 | + |
| 42 | +Наприклад: |
| 43 | + |
| 44 | +```console |
| 45 | +$ pwd |
| 46 | +/Users/me/code/go/src/helm.sh/helm |
| 47 | +$ scripts/sync-repo.sh fantastic-charts/ fantastic-charts |
| 48 | +Getting ready to sync your local directory (fantastic-charts/) to a remote repository at gs://fantastic-charts |
| 49 | +Verifying Prerequisites.... |
| 50 | +Thumbs up! Looks like you have gsutil. Let's continue. |
| 51 | +Building synchronization state... |
| 52 | +Starting synchronization |
| 53 | +Would copy file://fantastic-charts/alpine-0.1.0.tgz to gs://fantastic-charts/alpine-0.1.0.tgz |
| 54 | +Would copy file://fantastic-charts/index.yaml to gs://fantastic-charts/index.yaml |
| 55 | +Are you sure you would like to continue with these changes?? [y/N]} y |
| 56 | +Building synchronization state... |
| 57 | +Starting synchronization |
| 58 | +Copying file://fantastic-charts/alpine-0.1.0.tgz [Content-Type=application/x-tar]... |
| 59 | +Uploading gs://fantastic-charts/alpine-0.1.0.tgz: 740 B/740 B |
| 60 | +Copying file://fantastic-charts/index.yaml [Content-Type=application/octet-stream]... |
| 61 | +Uploading gs://fantastic-charts/index.yaml: 347 B/347 B |
| 62 | +Congratulations your remote chart repository now matches the contents of fantastic-charts/ |
| 63 | +``` |
| 64 | + |
| 65 | +## Оновлення вашого репозиторію чартів {#updating-your-chart-repository} |
| 66 | + |
| 67 | +Ви захочете зберегти локальну копію вмісту вашого репозиторію чартів або використати `gsutil rsync` для копіювання вмісту вашого віддаленого репозиторію чартів до локальної теки. |
| 68 | + |
| 69 | +Наприклад: |
| 70 | + |
| 71 | +```console |
| 72 | +$ gsutil rsync -d -n gs://bucket-name local-dir/ # прапорець -n виконує пробний запуск |
| 73 | +Building synchronization state... |
| 74 | +Starting synchronization |
| 75 | +Would copy gs://bucket-name/alpine-0.1.0.tgz to file://local-dir/alpine-0.1.0.tgz |
| 76 | +Would copy gs://bucket-name/index.yaml to file://local-dir/index.yaml |
| 77 | + |
| 78 | +$ gsutil rsync -d gs://bucket-name local-dir/ # виконує дії копіювання |
| 79 | +Building synchronization state... |
| 80 | +Starting synchronization |
| 81 | +Copying gs://bucket-name/alpine-0.1.0.tgz... |
| 82 | +Downloading file://local-dir/alpine-0.1.0.tgz: 740 B/740 B |
| 83 | +Copying gs://bucket-name/index.yaml... |
| 84 | +Downloading file://local-dir/index.yaml: 346 B/346 B |
| 85 | +``` |
| 86 | + |
| 87 | +Helpful Links: |
| 88 | + |
| 89 | +* Документація [gsutil rsync](https://cloud.google.com/storage/docs/gsutil/commands/rsync#description) |
| 90 | +* [Керівництво репозиторію чартів](/topics/chart_repository.md) |
| 91 | +* Документація щодо [версіювання обʼєктів та керування паралельністю](https://cloud.google.com/storage/docs/gsutil/addlhelp/ObjectVersioningandConcurrencyControl#overview) в Google Cloud Storage |
0 commit comments