Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare helm chart does not work when we use secretname reference for secrets. #86

Open
Taran-asapp opened this issue Dec 16, 2024 · 3 comments

Comments

@Taran-asapp
Copy link

Taran-asapp commented Dec 16, 2024

I'm trying to deploy the cloudflare tunnel using helm chart and i passed the secret name in the values.yaml file, but it seems like it is not able to read the secret correctly from the secrets. Getting the below error

2024-12-16T10:45:33Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0 event=0 
ip=x.x.x.x
2024-12-16T10:45:33Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0 event=0 ip=x.x.x.x
2024-12-16T10:45:33Z INF Retrying connection in up to 16s connIndex=0 event=0 ip=x.x.x.x

but when i modify the chart and pass tunnel token in the argument it is working as expected.
--token $TOKEN
To validate further, i create the yaml file from helm chart (using helm template command ) by passing all the values to the values.yaml, and created the secret from there and passed the reference of secret name in deployment but still name issue.

Version -- 2024.8.3
chart version -- 0.3.2

Any thoughts?

@vladciobancai
Copy link

Hi, I added the below and worked for me

cloudflare:
  tunnelName: 'cloudflare-tunnel'
  secretName: cloudflare-tunnel-credentials

@Taran-asapp
Copy link
Author

Hey @vladciobancai , can you please share the object defination of the secret, I tried this too, but it was not working for me.

@vladciobancai
Copy link

Hey @vladciobancai , can you please share the object defination of the secret, I tried this too, but it was not working for me.

I have used this tutorial https://developers.cloudflare.com/cloudflare-one/tutorials/many-cfd-one-tunnel/

the secret command kubectl create secret generic cloudflare-tunnel-credentials --namespace cloudflare --from-file=credentials.json=.cloudflared/1873ff49-10d9-4375-b6ea-7492a72cc0a1.json

the secret file

apiVersion: v1
kind: Secret
metadata:
  name: cloudflare-tunnel-credentials
  namespace: cloudflare
data:
  credentials.json: >-
    eyJBY2NvdW50VGFnIjoiYzk..... [base64 encode]
type: Opaque

the json is format of

{"AccountTag":"c952ce....","TunnelSecret":"s7l9zAvO....","TunnelID":"1873f...."}

the credentials json is created by running cloudflared tunnel create example-tunnel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants