問題描述
Concourse CI 找不到 kubernetes 機密 (Concourse CI can't find kubernetes secrets)
當跑步者嘗試檢索資源時,我收到以下錯誤:
checking failed ‑
Expected to find variables: git
我的資源類似於:
‑ name: resource‑repo
type: git
source:
uri: https://[url]
branch: master
tag_filter: '*'
username: ((git.username))
password: ((git.password))
舵圖的我的 values.yaml包括:
rbac:
create: false
credentialManager:
kubernetes:
namespacePrefix: concourse
(不管發布名稱是concourse)
在命名空間concourse‑main
下我有秘密:
Details
Name: git
Namespace: concourse‑main
Type: Opaque
Data
password: bytes
username: bytes
更多信息:
- k8s 1.8.6
- kops 1.8.1
- weavenet
- Concourse 3.9.1
參考解法
方法 1:
Based on information from the documentation:
By default, this chart will use Kubernetes Secrets as a credential manager. For a given Concourse team, a pipeline will look for secrets in a namespace named [namespacePrefix][teamName]. The namespace prefix is the release name hyphen by default, and can be overridden with the value
credentialManager.kubernetes.namespacePrefix
.
In your configuration, I see the secret in a namespace of your secret is concourse‑main
, but a default namespacePrefix
is concourse
.
So, Concourse trying to get your secret from a wrong namespace.
You can fix it using two ways:
- Create a secret in the namespace
concourse
. - Change
namespacePrefix
toconcourse‑main
.
(by Deano、Anton Kostenko)