如何将 Jinja 模板放入 spinnaker/echo 以进行 webhook 处理?

How do you get Jinja templates into spinnaker/echo for webhook processing?

我使用 Halyard 将 Spinnaker 1.10.5 部署到 Azure Kubernetes 服务。

我正在尝试使用这样的 echo-local.yml 获得 Azure Container Registry webhooks to trigger a pipeline. I found that you can set up echo to allow artifact webhooks

webhooks:
  artifacts:
    enabled: true
    sources:
    - source: azurecr
      templatePath: /path/to/azurecr.jinja

但是,我坚持 templatePath 值。由于我正在使用 Halyard 部署到 Kubernetes 中,所有配置文件都作为来自 Kubernetes 机密的卷安装。

如何将我的 Jinja 模板放入 Halyard 部署的 echo 以便它可以在自定义 webhook 中使用?

截至 Halyard 1.13 there will be the ability to custom mount secrets in Kubernetes

使用您的 Jinja 模板创建 Kubernetes 机密。

apiVersion: v1
kind: Secret
metadata:
  name: echo-webhook-templates
  namespace: spinnaker
type: Opaque
data:
  mytemplate:  [base64-encoded-contents-of-template]

~/.hal/default/profiles/echo-local.yml 中的 templatePath 设置为您安装密钥的位置。

网络挂钩: 工件: 启用:真 资料来源: - 来源:我的来源 模板路径:/mnt/webhook-templates/mytemplate

将坐骑添加到~/.hal/default/service-settings/echo.yml

kubernetes:
  volumes:
  - id: echo-webhook-templates
    type: secret
    mountPath: /mnt/webhook-templates

由于 Halyard 1.13 尚未真正发布,我显然还没有尝试过,但它应该 是这样工作的。另外...我想我可能会卡到那个时候。