kubernetes - 如何使用 Ansible 安装 GitLab,将正确的参数传递给 Helm?

标签 kubernetes ansible gitlab kubernetes-helm

我正在编写一个 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/

相关文章:

kubernetes - 使用 istio 连接到 Nodejs TLS 服务器时出现 NR filter_chain_not_found

docker - self 更新的Docker GitLab镜像

postgresql - chown :/var/lib/postgresql/data/postgresql. conf:只读文件系统

Kubernetes:工作 Pod 端点上的连接被拒绝

ansible - 使用 Ansible 时如何将选项传递给 dnf

ssh - 如何将公钥对 .pem 文件用于 ansible 剧本?

g++ - Project ERROR : Cannot run compiler 'g++' . 也许你忘了在 gitlab env 中设置环境

亚特实验室 CI : Multiple project

docker - 为什么我用Kubernetes在Ceph上收到 “Structure needs cleaning”消息?

kubernetes - 在组名中发现无效字符但未替换 ansible k8s