docker-cloudflare icon indicating copy to clipboard operation
docker-cloudflare copied to clipboard

[Feature] Support some combination of Environment variables and config file

Open polds opened this issue 5 years ago • 9 comments

Is your feature request related to a problem? Please describe. I use Kubernetes and it'd be really nice to commit the config file and have it save as a configmap, I can't because of the scopedToken, which I don't want to commit.

Describe the solution you'd like I'd like to be able to create the scopeToken as a generic secret in Kubernetes and inject it into my deployment as an environment variable and then further consider the config file which is a mounted configmap.

So I'd like the ability to pass some (or all) values as environment variables and then fallback to config.

Describe alternatives you've considered Right now my entire config is just a secret which makes updating the config difficult

polds avatar May 22 '20 03:05 polds

Right now my entire config is just a secret which makes updating the config difficult

As far as I know, there isn't really any different on updating secret or config. You can use stringData in secret.

joshuaavalon avatar May 24 '20 06:05 joshuaavalon

I suppose using stringData would work but it would require some pre-deploy step to pull out the token from some place. It would also prevent the ability to use Kustomize (I think). Edit: using stringData also prevents simple kubectl apply -f|k . deployments.

My ideal scenario is to use a Kustomize configMapGenerator and commit the entire raw yaml config to my repo (sans token) and have Kustomize generate the config map for me and use an environment variable for the token.

polds avatar May 24 '20 17:05 polds

@polds Ok, it sounds valid. I will try to implement it.

joshuaavalon avatar May 25 '20 02:05 joshuaavalon

Issues are closed after 30 days of inactivity. It’s been at least 20 days since the last update here.

github-actions[bot] avatar Jun 15 '20 00:06 github-actions[bot]

I'm not sure if this is the same issue, but I am also interested in some way to dynamically adding domains instead of using the config file.

i.e., I host a couple of services on my NAS and I just add a line like this to have traefik pick up this new service:

- "traefik.http.routers.api.rule=Host(sub.mydomain.tld)"

Which only works after I go and add the new sub.mydomain.tld to the config file of your image.

ovizii avatar Jul 18 '22 13:07 ovizii

I'm not sure if this is the same issue, but I am also interested in some way to dynamically adding domains instead of using the config file.

i.e., I host a couple of services on my NAS and I just add a line like this to have traefik pick up this new service:

- "traefik.http.routers.api.rule=Host(sub.mydomain.tld)"

Which only works after I go and add the new sub.mydomain.tld to the config file of your image.

Traefik can work like that because you need to give access of your Docker host to it.

If you want to update multiple DNS entries, you can use CNAME instead of A record. Use this image to update 1 A record and make the others CNAME records instead.

Cloudflare has CNAME flattening which gives the same result of multiple A records.

joshuaavalon avatar Jul 19 '22 01:07 joshuaavalon

Traefik can work like that because you need to give access of your Docker host to it.

If you want to update multiple DNS entries, you can use CNAME instead of A record. Use this image to update 1 A record and make the others CNAME records instead.

Cloudflare has CNAME flattening which gives the same result of multiple A records.

Thanks for your reply, but I am not sure if that is an improvement. Instead of having to add each new subdomain to this image's config file I now have to visit Cloudflare and set up a CNAME record for the new subdomain. Looks like the same amount of manual steps involved if I did not misunderstand your reply.

ovizii avatar Jul 19 '22 08:07 ovizii

Thanks for your reply, but I am not sure if that is an improvement. Instead of having to add each new subdomain to this image's config file I now have to visit Cloudflare and set up a CNAME record for the new subdomain. Looks like the same amount of manual steps involved if I did not misunderstand your reply.

You can combine with it with wildcard DNS entries if they are under the same domain.

joshuaavalon avatar Jul 20 '22 02:07 joshuaavalon

Issues are closed after 30 days of inactivity. It’s been at least 20 days since the last update here.

github-actions[bot] avatar Mar 19 '23 04:03 github-actions[bot]