cloudflare / cloudflare/helm-charts

feat: Allow users to inject credentials file separately

Open
#36 5 comments 4 reactions 0 assignees View on GitHub
Dominant language
Smarty
Stars
141
Forks
96
PR merge metrics
No merged PRs in 30d

Description

Helm charts certainly make things easier and more standardised, so I am glad this exists. My suggestion/feature request would be to allow users to inject the credentials file from a secret value, as at the moment the only way to pass the tunnel secret is through setting `.Values.cloudflare.secret`.

This is not ideal because:

a. It requires the whole chart to be a secret, which in many cases it might not be (example: if it just lives in Github)
b. Doesn't give flexibility for users to use external secrets managers

A couple of solutions are possible:

## 1. Encoding the whole local `values.yaml` as a secret

Correct if I am wrong, but this seems to be the only solution with the current approach (raw secret in the `values.yaml`). [ExternalSecrets users can leverage the templating engine](https://external-secrets.io/v0.9.0/guides/templating) to create a `values.yaml` that then is used by helm (well, at least with Flux it is possible to reference secrets as values).

If this is the way to go, perhaps might be good to leave some notes in the README on the safest way of doing this.

## 2. Change `cloudflared` to accept all credentials values via env variables and allow env injection in the chart

This is quite a common approach in other projects but probably would require refactoring not only this chart, but as well `cloudflared`. Possibly unlikely?

## 3. Chart accepts a `credentialsSecretRef`

In this case, users can map the credential file secret somewhere else and, the `secrets.yaml` shouldn't be used if this is set. Instead, the [`deployment.yaml`](https://github.com/cloudflare/helm-charts/blob/main/charts/cloudflare-tunnel/templates/deployment.yaml#L68-L70) would load the secret defined by the user.

This would be very handy, not attaching this project to any specific secret management solution, while still providing users standardisation through Helm.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.