代码之家  ›  专栏  ›  技术社区  ›  Travis Illig

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

  •  0
  • Travis Illig  · 技术社区  · 7 年前

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

    我正试着去 Azure Container Registry webhooks 触发管道。我发现 you can set up echo to allow artifact webhooks echo-local.yml 这样地:

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

    然而,我被困在了 templatePath 价值观。因为我将Halyard部署到Kubernetes中,所以所有的配置文件都作为卷从Kubernetes secrets装载。

    如何将我的Jinja模板放入我的吊绳 那么它可以在自定义webhook中使用?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Travis Illig    7 年前

    截至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]
    

    设定 templatePath ~/.hal/default/profiles/echo-local.yml

    网络挂钩: 人工产品: 已启用:true 资料来源: -资料来源:mysource

    将挂载添加到 ~/.hal/default/service-settings/echo.yml

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

    应该 工作。也。。。我想我可能会一直坚持到那时。

    推荐文章