-
Notifications
You must be signed in to change notification settings - Fork 27
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
Cluster wide storage for /etc/letsencrypt #9
Comments
@s4s0l You beat me to it :). I just released the support for secrets in DFP and was about to suggest the same to @hamburml. The idea is great and we should leverage secrets for certs. @hamburml I thought to add environment variable |
Hi!
To be honest, no. But it's also not sufficient to only store the certificates (it is for the proxy, but not for Certbot). Certbot (Let's Encrypt) creates account-information which are reused when a certificate is renewed. We need to store these too. I still wait for official infinit integration https://infinit.sh/docker @vfarcic @s4s0l |
@hamburml At the moment CFP would not know what to do with certs coming from secrets. We can change that. I thought to add env. var. The only new thing from those changes to DFP would be that certs would be loaded from |
Actually, it might be even easier for DFP. I can change configs to always use |
Correct, currently PUT request is used to send the certificates to the DFP. I would change DFLE to use secrets instead of PUT request when a env. var. is set. Thanks for the info :) |
@hamburml Secrets are added to DFP. A user will have to create proxy service with a secret (it can be even an empty file; to be tested). From there on, you can update that secret whenever you fetch a new cert. I don't think we'll even need to reload the proxy config (to be tested). If we do, a |
@hamburml Do you think you'll be able to work on this issue? |
@vfarcic I haven't abandoned this companion service and I really want to work on this matter. I will try to add it this week. |
hamburml/docker-flow-letsencrypt:testing sends certificates via docker secret to DFP when https://hub.docker.com/r/hamburml/docker-flow-letsencrypt/tags/
edit
First command removes old secret from the proxy, removes the secret itself, adds the secret (the new certificate) and adds the secret to the proxy. When the secret is removed from the proxy (first command) and the secret is added (last command) the service is restarted (I don't know if it's really restarted, but it's not reachable for a very short time. When using PUT Request for storing certificates this works without any downtime (or it was so fast it never occurred to me). |
I thought about using docker api directly instead of docker cli. There is an update command but sadly the data itself can't be updated. https://docs.docker.com/engine/api/v1.28/#operation/SecretUpdate So sad :/ I think it's better to not use secrets for the certificates in the current situation. When a certificate is updated a simple PUT Request sends it to DFP. This happens without a downtime. When the certificate is stored as a docker secret, DFP needs to be stopped, secret removed and recreated with the new certificate file and DFP restarted with the new secret (the 4 commands in the post above). Any ideas/thoughts about this? |
I agree. It will be better to use |
What about "secret versioning". Secrets are immutable but you could emulate secret versioning adding a predefined sufix to each secret, for example: When the proxy is restarted only the last version is initialized in the proxy. |
I'm not sure I understand @bvis. That would mean that when a new certificate comes in, the proxy will need to be restarted so that the new secret is added. I'm probably missing something... |
Yeah, secrets aren't renewed when a container is currently running - a new secret (even a fully new secret with versioning as mentioned) results in a restart of DFP which is a downtime. |
You are right. I assumed it won't need to restart when you use It can be seen in the official docs: https://docs.docker.com/engine/swarm/secrets/#example-rotate-a-secret |
Hey, is this part of a tagged release? |
No, sorry. I/We abandoned the secret approach and I would favor a new For example DFP restarts, doesn't have a certificate but knows through some env. var. that there is a service which can provide certificates. It sends a request to DFLE and DFLE sends all available certs to DFP. I would like to change the compantion to allow something like this. |
First of all great job @hamburml & @vfarcic.
I must admit at the beginning, that I haven't run docker-flow even once. Just was looking at the source code to evaluate if it fits my needs. So far I think I'll give it a try and I like it a lot.
I was also going through some open/closed issues ad came across vfarcic/docker-flow-proxy#56, there was a discussion about /etc/letsencrypt. While i was thinking about it some crazy idea came to me so i decided to share it with you. Hope you don't mind bothering you;)
What if docker-flow-letsencrypt or some companion container mounted /var/run/docker.sock of manager node and saved current keys or/and certbot files as secret in swarm? How much storage is needed here?
I've seen sentence "mount /etc/letsencrypt will be improved in the future", do you have any idea how? I'll be facing this problem in near future so maybe I can help.
Using Ceph, Gluster or Swift in sole purpose of storing few kb of data is a little overkill for me.
I'm going to give https://github.com/cpuguy83/docker-kvfs-driver a try.
The text was updated successfully, but these errors were encountered: