From 188ec71bcf65b3bcf324369355afcd5a7d83442b Mon Sep 17 00:00:00 2001 From: Timofey Kirillov Date: Fri, 6 May 2022 18:43:33 +0300 Subject: [PATCH] feat(docs): added info about deploying bundles as helm chart dependencies Signed-off-by: Timofey Kirillov --- docs/pages_en/advanced/bundles.md | 30 +++++++++++++++++++++++++++++- docs/pages_ru/advanced/bundles.md | 30 +++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/docs/pages_en/advanced/bundles.md b/docs/pages_en/advanced/bundles.md index b785e1ee68..4b4cdaea8d 100644 --- a/docs/pages_en/advanced/bundles.md +++ b/docs/pages_en/advanced/bundles.md @@ -36,12 +36,40 @@ When publishing a bundle by the tag which already exists in the container regist ## Bundles deployment -Bundle published into the container registry could be deployed into the kubernetes by the werf. +Bundle published into the container registry could be deployed into the kubernetes by the werf with one of the following ways: + 1. With `werf bundle apply` command directly from container registry. + 2. From another werf project as helm chart dependency. + +### Deploy with werf bundle apply [werf-bundle-apply]({{ "/reference/cli/werf_bundle_apply.html" | true_relative_url }}) command used to deploy a published bundle version into the kubernetes. This command **does not need a project git directory** to run, because bundle contains all needed files and images to deploy an application. This command accepts params which is analogous to [werf-converge]({{ "/reference/cli/werf_converge.html" | true_relative_url }}) command. For `werf bundle apply` you should explicitly specify Helm release name (`--release`) and namespace to be used for deployment (`--namespace`). [Values for helm chart]({{ "/advanced/helm/configuration/values.html" | true_relative_url }}), [annotations and labels]({{ "/advanced/helm/deploy_process/annotating_and_labeling.html" | true_relative_url }}) which has been passed to the [werf-bundle-apply]({{ "/reference/cli/werf_bundle_apply.html" | true_relative_url }}) command will be united with the values, annotations and labels, which has been passed during publication of the bundle being applied. +### Deploy as helm chart dependency + +Configure dependency in the target werf project `.helm/Chart.yaml`: + +```yaml +apiVersion: v2 +dependencies: +- name: project + repository: "oci://ghcr.io/group" + version: 1.4.x +``` + +Update project chart dependencies (this command will actualize `.helm/Chart.lock`): + +``` +werf helm dependency update .helm +``` + +Deploy project with dependencies: + +``` +werf converge --repo ghcr.io/group/otherproject +``` + ### Versioning during deployment User may choose a version of deployed bundle with `--tag` parameter. By default, bundle with the `latest` tag will be deployed. diff --git a/docs/pages_ru/advanced/bundles.md b/docs/pages_ru/advanced/bundles.md index b95ea52ad2..dc06f00465 100644 --- a/docs/pages_ru/advanced/bundles.md +++ b/docs/pages_ru/advanced/bundles.md @@ -36,12 +36,40 @@ werf позволяет разделить процесс выпуска нов ## Выкат бандлов -Бандл, опубликованный в container registry, можно выкатить в kubernetes с помощью werf. +Бандл, опубликованный в container registry, можно выкатить в kubernetes с помощью werf одним из следующих путей: + 1. С помощью команды `werf bundle apply` напрямую из container registry. + 2. Из другого проекта werf в качестве зависимого helm-чарта. + +### Выкат с помощью werf bundle apply Выкат опубликованного бандла осуществляется с помощью команды [`werf bundle apply`]({{ "/reference/cli/werf_bundle_apply.html" | true_relative_url }}). Команда **не требует доступа к git** (бандл содержит все необходимые файлы и образы для выката приложения), и принимает параметры по аналогии с [`werf converge`]({{ "/reference/cli/werf_converge.html" | true_relative_url }}). Для `werf bundle apply` необходимо явно указывать имя создаваемого Helm-релиза (`--release`) и namespace, в который будет совершён выкат (`--namespace`). Переданные [values для helm chart]({{ "/advanced/helm/configuration/values.html" | true_relative_url }}), [аннотаций и лейблов для ресурсов]({{ "/advanced/helm/deploy_process/annotating_and_labeling.html" | true_relative_url }}) будут объединены с теми values, аннотациями и лейблами, которые были указаны при публикации бандлов и зашиты в него. +### Выкат в качестве зависимого helm-чарта + +Настраиваем зависимость в целевом werf-проекте в файле `.helm/Chart.yaml`: + +```yaml +apiVersion: v2 +dependencies: +- name: project + repository: "oci://ghcr.io/group" + version: 1.4.x +``` + +Обновляем зависимости проекта (данная команда актуализирует файл `.helm/Chart.lock`): + +``` +werf helm dependency update .helm +``` + +Выкатываем проект с зависимостями: + +``` +werf converge --repo ghcr.io/group/otherproject +``` + ### Версионирование при выкате При выкате пользователь может выбрать версию выкатываемого бандла с помощью параметра `--tag`. По умолчанию выкатывается бандл по тегу `latest`.