Using k8s secrets in concourse pipeline

11/27/2018

This question is similar to this one Concourse CI can't find kubernetes secrets . However, the marked solution in it did not work for me.

I have setup concourse using this helm chart https://github.com/helm/charts/tree/master/stable/concourse

My release name is concourse-ci. So, my namespace prefix is concourse-ci- and the team name is main.

So, following the documentation https://github.com/helm/charts/tree/master/stable/concourse#kubernetes-secrets I created my secrets like this

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>

In mu pipeline, I have the following:

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

When, I execute the pipeline with the above code, it gets' stuck. However, if I replace ((git.username)) and ((git.password)) with the actual values, it works perfectly fine.

Am I missing something? I tried creating the secret in concourse-ci instead of concourse-ci-main, but I still get the same error.

I have the following in values.yml

kubernetes:
  enabled: true

and

rbac:
  # true here enables creation of rbac resources
  create: false
-- kosta
concourse
concourse-git-resource
kubernetes-secrets

0 Answers