我正在编写一个 Ansible 任务来在我的 k3s 环境中部署 GitLab。
根据文档,我需要执行此操作才能使用 Helm 安装 GitLab:
$ helm install gitlab gitlab/gitlab \
--set global.hosts.domain=DOMAIN \
--set <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0c6f697e78616d626d6b697e21657f7f79697e2269616d65603161694c69746d617c6069226f6361" rel="noreferrer noopener nofollow">[email protected]</a>
但 community.kubernetes.helm
不处理 --set
参数,仅使用 --values
参数调用 helm。
所以我的 Ansible 任务如下所示:
- name: Deploy GitLab
community.kubernetes.helm:
update_repo_cache: yes
release_name: gitlab
chart_ref: gitlab/gitlab
release_namespace: git
release_values:
global.hosts.domain: example.com
certmanager-issuer.email: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7811161e17381d00191508141d561b1715" rel="noreferrer noopener nofollow">[email protected]</a>
但是 helm 图表仍然返回错误 您必须提供电子邮件才能与您的 TLS 证书关联。请设置certmanager-issuer.email。
我已经在终端中手动尝试过,似乎 GitLab helm 图表需要 --set
参数并因 --values
失败。但community.kubernetes.helm 却没有。
我能做什么?
GitLab Helm Chart 端是否存在错误?
最佳答案
it seems that the GitLab helm chart requires --set parameters and fail with --values
这是一个错误的假设;您遇到的是 --set
在 .
上拆分,因为否则在命令行上提供完整格式的 YAML 会很痛苦
正确的值是使用出现 .
的子对象:
- name: Deploy GitLab
community.kubernetes.helm:
update_repo_cache: yes
release_name: gitlab
chart_ref: gitlab/gitlab
release_namespace: git
release_values:
global:
hosts:
# https://gitlab.com/gitlab-org/charts/gitlab/-/blob/v4.4.5/values.yaml#L47
domain: example.com
# https://gitlab.com/gitlab-org/charts/gitlab/-/blob/v4.4.5/values.yaml#L592-595
certmanager-issuer:
email: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b52555d547b5e435a564b575e15585456" rel="noreferrer noopener nofollow">[email protected]</a>
关于kubernetes - 如何使用 Ansible 安装 GitLab,将正确的参数传递给 Helm?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64761112/