首页 > 解决方案 > 在大厅管道中使用 k8s 机密

问题描述

这个问题类似于这个Concourse CI can't find kubernetes secrets。但是,其中的标记解决方案对我不起作用。

我已经使用这个舵图设置了大厅https://github.com/helm/charts/tree/master/stable/concourse

我的发布名称是concourse-ci. 所以,我的命名空间前缀是concourse-ci-,团队名称是main.

因此,按照文档https://github.com/helm/charts/tree/master/stable/concourse#kubernetes-secrets我创建了这样的秘密

apiVersion: v1
kind: Secret
metadata:
  name: git
  namespace: concourse-ci-main
type: Opaque
data: #Base 64 (can be removed)
  username: <base64 encoded username>
  password: <base64 encoded password>

在 mu 管道中,我有以下内容:

resources:
- name: my-repo
  type: git
  source:
    uri: <my-uri>
    branch: develop
    username: ((git.username))
    password: ((git.password))

当我使用上面的代码执行管道时,它会卡住。但是,如果我用实际值替换((git.username))((git.password)),它工作得很好。

我错过了什么吗?我尝试在concourse-ci而不是创建秘密concourse-ci-main,但我仍然得到同样的错误。

我有以下内容values.yml

kubernetes:
  enabled: true

rbac:
  # true here enables creation of rbac resources
  create: false

标签: concoursekubernetes-secretsconcourse-git-resource

解决方案


推荐阅读